[Javascript] Press enter submits form

Harry Love hlove at u.washington.edu
Mon Aug 26 17:31:03 CDT 2002


<snip>
Yes- that's the default behavior, but for a page with multiple forms and
submit buttons when enter is pressed I want to be able to simulate the
sumbit of a particular form.

David
</snip>

Sorry, I'm a visual learner.  From the above, here's what I'm picturing
in my mind (rough sketch):

<body>
<form1>
<some form elements>
<submit button>
</form>

<form2>
<some form elements>
<submit button>
</form>

<form3>
<some form elements>
<submit button>
</form>

</body>


Is that roughly what you have on your page?  If not, please send a URL.
If it is, and the user's mouse is inside one of the forms, I believe
only that form will submit when the [enter] key is pressed.

Harry




More information about the Javascript mailing list