Changing Default Behavior of Enter Key in Forms
I'm being asked to change the default behavior of pressing the Enter key in forms from submitting the form to making it act as the Tab key (moving the cursor from field to field).
Is this possible? I know I can keep the form from being submitted if the Enter key is prematurely pressed, but how would one change it to act like the Tab key?
Abhishek Reddy posted this at 21:15 — 29th July 2004.
He has: 3,348 posts
Joined: Jul 2001
Not a good idea to change default behaviours in the first place.
It's even more dangerous since you'll have to use Javascript. What if the user has JS turned off in their browser? Suppose you put instructions on the page to hit enter, and it submitted instead?
andy206uk posted this at 15:47 — 2nd August 2004.
He has: 1,758 posts
Joined: Jul 2002
It can be done... I'm sure I saw a script to do it either on wsabstract.com or dynamicdrive.com
Like Abhishek says... Don't do it.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.