Hidden field not passed to next page.

S

Scott

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
 
V

vdP

Scott said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top