File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes hidden variable? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "hidden variable?" Watch "hidden variable?" New topic
Author

hidden variable?

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3829
Dear all,

What is hidden variable and how to add and send them with request? Why we use them?

Thanks.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12265
    
    1
I am guessing that you mean a hidden field in an HTML form.
As far as servlet request objects are concerned, the value in a hidden field is treated just like other form values.
You can write a value into a field when the html page is created or have Javascript put a value there.
Use hidden fields for any text value that you want to have submitted with the request but that you don't want the user to see or modify.
Bill


Java Resources at www.wbrogden.com
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3829
Originally posted by William Brogden:
I am guessing that you mean a hidden field in an HTML form.
As far as servlet request objects are concerned, the value in a hidden field is treated just like other form values.
You can write a value into a field when the html page is created or have Javascript put a value there.
Use hidden fields for any text value that you want to have submitted with the request but that you don't want the user to see or modify.
Bill


Thanks William. I got it completely.

But, how to write them in HTML page or through Javascript? Please, could some body give me code...

Thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56153
    
  13

The HTML 4 Specification.

Also an excellent HTML 4 reference.
[ December 11, 2005: Message edited by: Bear Bibeault ]

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Gaurav Chhabras
Ranch Hand

Joined: Sep 21, 2005
Posts: 126
example is -:

<input type="hidden" name="user_name" value="">

then this field will go to next page as you submit the page but not being able to view bu the user
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: hidden variable?
 
Similar Threads
Relation between Interface Varable Declaration Same Implementar variable Declarateion
Pass hidden variable to FRAMES
encode and decode url query string values
How do I get values from previous html?
Is this illegal in JSP