Discussion Locked

Set focus on form submit botton

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have an html form that collects a user name and password. When I enter the user name and password, I would like to just hit enter to send the form as opposed to tabing to the submit button. I thought that this just happened automatically, but itdoes not happen on my form. What do I do?

5 replies

by jay eckles

This has to be implemented by the browser that the user is using. In IE (only), the following script will submit the form when the user presses ENTER:

...well, at least I think it will do that - I haven't bothered to test it. Also, know that this will submit the form if the user hits ENTER anywhere on the page. You might try changing the "for" attribute of the script to "document.formname.inputname".

Good luck.

Jay

This discussion is closed to new replies.