View Full Version : Assigning submit button to the enter key

11-06-2010, 03:28 AM
I have two submit buttons on one form on my site. Is there a way to assign which fields on the form, when enter is pressed, activates a certain submit button and not the other?

11-07-2010, 01:00 AM
Is this even possible?

11-07-2010, 01:07 AM
could be possible, I suppose with some JS. Of course, if you move the cursor using the tab key, to give focus to the correct submit button, the enter key will 'use' it because it has been highlighted.

Is this for a public website? If so, why do something different from the standard way of user interfacing, which can only confuse visitors?


11-07-2010, 02:28 AM
You can try to do it by using Javascript, when clicking one submit button pass the value of the selected form fields when clicking submit button, for this write a function using javascript and call the function onSubmit()..