Hidden field not passed to next page.

Discussion in 'HTML' started by Scott, Nov 20, 2005.

  1. Scott

    Scott Guest

    I am trying to pass value by Hidden field to the next page. However,
    only the NO Hidden fields are successfully passed. All hidden fields
    failed to be passed and are null in the next page. Following is the
    JSP code

    <%@ page language = "java" %>
    <%@ page import = "java.text.*, java.util.*" %>

    <jsp:useBean id="Emp" class="com.abc.EmployeeAdmin" scope="page" />

    <%
    String loginID = request.getParameter("loginID");
    ....
    %>
    ....
    <FORM name="FormUpdEmp" method="POST" action="action_upd.jsp">
    <inpup type="hidden" name="userID" value="test">
    <inpup type="hidden" name="userName" value="Bush">

    <table border=0 cols=2 width=100%>
    ....
    </table>
    ....

    I tried to change POST to GET, the results of the next page are exactly
    same.

    I tried JavaScript to set the hidden fields before submit, but failed
    also:

    ....
    <SCRIPT Language="JavaScript">

    function Validate(id) {

    alert("enter Validate: id = " + id);
    document.FormUpdEmp.userID = id;
    alert("userID = " + document.FormUpdEmp.userID);

    document.FormUpdEmp.submit();
    }

    </SCRIPT>
    </HEAD>
    .....

    In the above JavaScript, it is strange that I cannot use statement
    document.FormUpdEmpl.userID.value = id;
    or
    alert("userID = " + document.FormUpdEmp.userID.value);
    only the statement without .value can be successfully submitted and get
    next page opened.

    I cannot figure out what exactly caused the problem. The web server is
    Tomcat 5.5.12 on Unix and the IE is version 6.0.2900.2180

    Thanks so much.

    Scott
    Scott, Nov 20, 2005
    #1
    1. Advertising

  2. Scott

    vdP Guest

    Scott wrote:
    > I am trying to pass value by Hidden field to the next page. However,
    > only the NO Hidden fields are successfully passed. All hidden fields
    > failed to be passed and are null in the next page. Following is the
    > JSP code
    >
    > <FORM name="FormUpdEmp" method="POST" action="action_upd.jsp">
    > <inpup type="hidden" name="userID" value="test">
    > <inpup type="hidden" name="userName" value="Bush">


    Shouldn't that be "input" instead of "inpup" ?

    vdP
    vdP, Nov 20, 2005
    #2
    1. Advertising

  3. Scott

    Scott Guest

    It is the problem!
    Can't believe I missed even checked.

    Thanks so much, vdP!

    vdP wrote:
    > Scott wrote:
    > > I am trying to pass value by Hidden field to the next page. However,
    > > only the NO Hidden fields are successfully passed. All hidden fields
    > > failed to be passed and are null in the next page. Following is the
    > > JSP code
    > >
    > > <FORM name="FormUpdEmp" method="POST" action="action_upd.jsp">
    > > <inpup type="hidden" name="userID" value="test">
    > > <inpup type="hidden" name="userName" value="Bush">

    >
    > Shouldn't that be "input" instead of "inpup" ?
    >
    > vdP
    Scott, Nov 20, 2005
    #3
  4. Scott

    Jemdam.com Guest


    > It is the problem!
    > Can't believe I missed even checked.
    >

    All bugs are typos in one way or another. I know how you feel! Cheers, David
    Jemdam.com, Nov 21, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dee
    Replies:
    9
    Views:
    488
    Joseph Byrns
    Apr 15, 2005
  2. Anand
    Replies:
    2
    Views:
    883
    Anand
    Sep 11, 2003
  3. Deniz Bahar
    Replies:
    2
    Views:
    443
    Andrey Tarasevich
    Mar 9, 2005
  4. Rick
    Replies:
    3
    Views:
    8,072
    Alexey Smirnov
    Apr 13, 2010
  5. GavMc
    Replies:
    4
    Views:
    304
    Evertjan.
    Sep 22, 2005
Loading...

Share This Page