[Home]Enter key

HomePage | RecentChanges | Preferences | Newbie Help

Category HTML Forms

Jukka K. Korpela says:

There are a few things you might manage to do using client-side scripting in this area. Nothing to be relied on, etc., but you might sometimes prevent people from submitting a form accidentally: http://www.cs.tut.fi/~jkorpela/forms/enter.html


Comments --

Brad Baxter says --

In my experience, IE does this differently than Netscape. There are of course other browsers, but I can't tell you about their behavior.

The "rule" for IE appears to be the following:

If the focus is in a type="text" input box, and there is ONLY ONE submit button, then pressing enter is identical to clicking the submit button.

If the focus is in a text input box, and there are multiple submit buttons, then pressing enter will submit the form but will not transmit the name=value pair for any submit button.

The "rule" for Netscape appears to be the following:

If there is ONLY ONE type="text" input box in the form, and the focus is in it, then pressing enter submits the form but does not transmit the name=value pair for any submit button, even if there is only one.

If there are multiple type="text" input boxes, and the focus is anywhere but the submit button, pressing enter does not submit the form.

This may or may not help. :-)

-- Brad Baxter On 9 Mar 2001 09:41:55 -0800, in comp.infosystems.www.authoring.cgi

I have a different problem: I have a form but my submit button is an image, i want to use javascript to force a submit when i press on the enter button? any ideas? please email me at conejo@centraal.boekhuis.nl or jaime@cumquat.nl


HomePage | RecentChanges | Preferences | Newbie Help
This page is read-only | View other revisions
Last edited August 30, 2002 9:59 am (diff)
Search:

This FAQ is happily hosted by Betadome Digital Media