Read Form Selection Control : Form Select « JSP « Java Tutorial






index.jsp

<HTML>
    <HEAD>
        <TITLE>Submitting Select Controls</TITLE>
    </HEAD>
 
    <BODY>
        <H1>Submitting Select Controls</H1>
        <FORM ACTION="basic.jsp" METHOD="POST">
            <SELECT NAME="select1">
                <OPTION>Option 1</OPTION>
                <OPTION SELECTED>Option 2</OPTION>
                <OPTION>Option 3</OPTION>
            </SELECT>
            <INPUT TYPE="submit" VALUE="Submit">
        </FORM>
    </BODY>
</HTML>

basic.jsp

<HTML>
    <HEAD>
        <TITLE>Reading Select Controls</TITLE>
    </HEAD>

    <BODY>
        <H1>Reading Select Controls</H1>
        You selected 
        <% out.println(request.getParameter("select1")); %>
    </BODY>
</HTML>
  Download:  ReadFormSelectionControl.zip( 1 k)








23.23.Form Select
23.23.1.Read Form Multiple Selection Control
23.23.2.Read Form Selection Control
23.23.3.Deal with Form TextField and Select Option