Get submit button value : Form Post « JSP « Java Tutorial






<HTML>
    <HEAD>
        <TITLE>Get submit button value</TITLE>
    </HEAD>

    <BODY>
        <H1>Using Multiple Forms</H1>
        <% 
            if(request.getParameter("submit") != null) {
        %>
            You clicked 
            <%= request.getParameter("submit") %>
        <%
            }
        %>

        <FORM NAME="form1" METHOD="POST">
            <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Button 1">
        </FORM>

        <FORM NAME="form2" METHOD="POST">
            <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Button 2">
        </FORM>

        <FORM NAME="form3" METHOD="POST">
            <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Button 3">
        </FORM>
    </BODY>
</HTML>








23.26.Form Post
23.26.1.Get Form Parameter Enumeration
23.26.2.Get Form Parameter By Index
23.26.3.Form Calculator
23.26.4.Process the Form action in the save page
23.26.5.Use multiple forms
23.26.6.Get submit button value