Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Hidden field not passed to next page.

Reply
Thread Tools

Hidden field not passed to next page.

 
 
Scott
Guest
Posts: n/a
 
      11-20-2005
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

 
Reply With Quote
 
 
 
 
vdP
Guest
Posts: n/a
 
      11-20-2005
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
 
Reply With Quote
 
 
 
 
Scott
Guest
Posts: n/a
 
      11-20-2005
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


 
Reply With Quote
 
Jemdam.com
Guest
Posts: n/a
 
      11-21-2005

> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate Hidden field on post back and retrieve value from Hidden Field Rick ASP .Net 3 04-13-2010 05:38 PM
how to retrieve hidden field value in next page in asp.net? priyajee Software 2 12-09-2009 01:02 PM
1.Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Sound Javascript 2 09-28-2006 02:43 PM
Pass hidden form field value to another form field to insert in db GavMc ASP General 4 09-22-2005 06:33 PM
CurrentElement->next = CurrentElement->next->next (UNDEFINED?) Deniz Bahar C Programming 2 03-09-2005 12:45 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57