Read Hidden Control in Same File : Form Input Data « JSP « Java Tutorial






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

    <BODY>
        <H1>Reading Hidden Controls</H1>
        <% 
            String text = "";
            if(request.getParameter("TEXT1") != null) {
                out.println("The hidden text is:" + request.getParameter("TEXT1")); 
                text = request.getParameter("TEXT1");
            }
        %>
        <FORM ACTION="basic.jsp" METHOD="POST">
            <INPUT TYPE="TEXT" NAME="TEXT1">
            <INPUT TYPE="HIDDEN" NAME="HIDDEN" 
                VALUE="<%= text%>">
            <INPUT TYPE="SUBMIT" VALUE="Set Hidden Text">
        </FORM>
    </BODY>
</HTML>
  Download:  ReadHiddenControlInSameFile.zip( 1 k)








23.25.Form Input Data
23.25.1.Use Loop to Read Form Controls
23.25.2.Use For Each to Loop Through all Values Passed in by Form
23.25.3.Read Hidden Control in Same File
23.25.4.Pass Form Value to Bean
23.25.5.Form with Error Checking