Dear All, I have a form with multi submit buttons like this
<FORM NAME="form1" METHOD="POST" Action="SomePage.jsp">
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Button 1">
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Button 2">
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Button 3">
</FORM>
How can i get the submit value using JSP ?
It's just by its name available as request parameter as well. String submit = request. getParameter("submit");
Value. An <input type="submit"> element's value attribute contains a string which is displayed as the button's label. Buttons do not have a true value otherwise.
Definition and Usage The value attribute specifies the initial value for a <button> in an HTML form. Note: In a form, the button and its value is only submitted if the button itself was used to submit the form.
It's just by its name available as request parameter as well.
String submit = request.getParameter("submit");
That said, a JSP is the wrong place to postprocess a form submit. Use a Servlet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With