Can someone tell me what is the Event that is fired when the user presses enter on a Page in order for me to execute sme code

For example, instead of clicking on a Submit Button what VBScript would I need if the user just presses the ENTER key

Many thank
Mark

On Enter by Tom

Tom
Tue Mar 02 07:31:45 CST 2004

The event you want is onkeypress, but you will need to
process the window.event.keycode to determine whether it
is the Enter key (code 13 decimal).

For example, for the text box control, you could define it
something like this ...

<input type=text
onkeypress="if window.event.keycode=13 then SubmitIt">

This presumes VBScript was previously declared as the
script language. Otherwise, prefix the statement in
parens with 'vbscript:'

If you want it to take effect over a wider domain, include
the onkeypress handler in another element that encompasses
the wider context.

Tom Lavedas
===========

>-----Original Message-----
>Can someone tell me what is the Event that is fired when
the user presses enter on a Page in order for me to
execute sme code.
>
>For example, instead of clicking on a Submit Button what
VBScript would I need if the user just presses the ENTER
key.
>
>Many thanks
>Mark
>.
>