Hi, I have a question on submitting a form in a JSP. I have a form that contains 2 submit buttons and a text field. If a user enters a value in the text field and then presses the Enter button on the keyboard, the form should get submitted. My question is which submit is used since there are two buttons? Does the first submit button get used? Can I set a default submit button?
Why two submit buttons? If only one is to have submit semantics, make it the submit button and leave the other without submit behavior.
Joined: Aug 31, 2004
Good question. It is because we are using a third party vendor's tool which abstracts all of the Form and form elements. For example, instead of being able to code a submit or plain button input, we use a graphical widget to drop a button into a template. The button widget is always of type "submit". I have to use a "View Source" in order to see the actual html that gets produced.