|
Posted by Jukka K. Korpela on 07/12/06 22:12
Robert S <robert.spam.me.senseless@gmail.com> scripsit:
> I have a rather large page with an arbitrary number of "submit"
> buttons. When a user enters something in a Text field and presses the
> "Enter" key, the wrong action occurs (usually the "Delete" key gets
> pressed!).
This is a special case (and apparently a particularly nasty case) of the
problem "how do I prevent a form from being submitted when the user hits
Enter?". The answer is, more or less, "You don't; cope with it when it
happens".
See http://ppewww.ph.gla.ac.uk/~flavell/www/formquestion.html
The safe, though sometimes a bit clumsy, approach is that you don't have
several submit buttons (when the form contains at least one text input
field).
This means that you don't have, say, "Delete", "Add" and "Change" submit
buttons. Instead, you have e.g. radio buttons for selecting the action to be
made, with such values, and a single submit button.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Navigation:
[Reply to this message]
|