Possible Duplicate:
Submitting a form with the enter button in a form with several submit buttons
I have an html form with two submit buttons.
How can I set the default button that is ‘clicked’ when a user presses enter whilst in said form?
As @quentin pointed out, the first button is used to submit when ‘enter’ is pressed…
So how would I make the 2nd button default for example?
EDIT: To clarify: Let’s say there is a form that doubles as a login and registration form. THere are two buttons: one to register; one to sign up. What if I want the second button to be ‘clicked’ when the user presses enter?
Thanks!!
Put that button first (in browsers that will trigger any button when the form is submitted with enter (and set a default for when neither of the buttons is successul in your server side processor)).