html - Is there a way to use two differents submit buttons in a same form? -


i trying use 2 different submit buttons in same form. each submit button, call specific servlet.

i tried use onclick this, if submit button out of form, cant receive parameters in servlet. returning null.

is there anyway this?

you can have 2 (or more) submit buttons, there can 1 target (there exception, explain below). being said, button clicked sent form data, if name it, can check existence , call relevant servlet.

html5 defines formaction attribute on submit buttons, allow submit different target depending on button clicked. however, it new feature not supported in browsers, can cause problems if people using older version.

ideally, should have form's action attribute script decides button clicked, , add formaction attributes submit buttons direct form straight relevant file.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -