General discussion

Locked

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.

1 total post (Page 1 of 1)  
| 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(); }');
}
// ]]> -->
</script>
?
<body onload=?setEvents()?>

Hope this helps.

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums