Web Development

General discussion


when using DTC's, How to make the Enter Key to submit form?

By hurrey ·
I am using DTC's (Design-Time control) for textboxes and I need help - how to make enterkey work like submitting the form. Can anyone please help me ?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

Event handler

by Ed Woychowsky In reply to when using DTC's, How to ...

I?m not a big fan of Design Time Controls, but that is another matter, to have the enter key submit the form you?ll need to set an event handler. The following code will do the trick for Internet Explorer:

<script language='JavaScript'>
<!-- <![CDATA[

function setEvents() {
document.body.onkeyup = new Function('if(window.event.keyCode == 13) { document.thisForm.submit(); }');
// ]]> -->
<body onload=?setEvents()?>

Hope this helps.

Related Discussions

Related Forums