[WEB4LIB] submit button

Thomas Dowling tdowling at ohiolink.edu
Wed Nov 21 14:27:35 EST 2001


> Here's a question I hope someone can help me with. I have a form on
> the web... In some browsers patrons can enter data by hitting the
> enter key on the keyboard. I want to make submitting the form
> information possible only by using the submit button on the form. Is
> there something I can put in the script to disable the enter key? I
> am using Active Server Pages. Thank you, Amy


Out of curiosity, why?

There's no reliable way to make some browsers stop doing this.  IE4+ maps
Enter to the first submit input in a form.  IE5+ maps it to the first
submit or image input.  You may want to concentrate on what specific
problem arises if people hit Enter (incomplete forms?) and figure out
solutions to those specific problems (form validation routines?).

Theoretically, and at the risk of frustrating a large percentage of your
users, you could have more than one submit input, and have the first tied
to an action that doesn't "really" submit the form.  Variations on this
theme are included in the discussion on this subject at
<http://ppewww.ph.gla.ac.uk/~flavell/www/formquestion.html>.

Thomas Dowling
OhioLINK - Ohio Library and Information Network
tdowling at ohiolink.edu



More information about the Web4lib mailing list