Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
JSP
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

Hidden Form Fields

                          

Hidden form field is used to maintain the session. It is one of the way to maintain the session. In hidden form fields the html entry will be like this : <input type ="hidden" name = "name" value="">. This means that when you submit the form, the specified name and value will be get included in get or post method. In this session ID information would be embedded within the form as a hidden field and submitted with the http post command. 

In this program of hidden form fields firstly we are making a jsp form or html form in which we are using the post method and where the request will be submitted or controlled, it is done by a controller SettingHiddenField.jsp, it is the jsp where the business will be applied.  

The code of the program is given below:

<HTML>
    <HEAD>
        <TITLE>Submitting Hidden Fields</TITLE>
    </HEAD>
 
    <BODY>
        <H1>How to use a Hidden fields </H1>
        <FORM ACTION="SettingHiddenField.jsp" METHOD="post">
			Enter your name : <input type ="text" name = "name" value = ""> 
            <input type="hidden" name="hidden" value="You are most Welcome!">
            <input type="submit" value="submit">
        </FORM>
    </BODY>
</HTML>

 

<HTML>
  <HEAD>
    <TITLE>Reading Hidden Controls</TITLE>
  </HEAD>
    <BODY>
        <H1>Reading Hidden Controls</H1>
        <% 
			String string = request.getParameter("name");
            String text = "";
            if(request.getParameter("text1") != null) {
                out.println(string + "The hidden 
text is:" +request.getParameter("text1")); text = request.getParameter("text1"); } %> <FORM ACTION="GettinHiddenField.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>

 

<HTML>
<HEAD>
<TITLE>The Hiddern Fields</TITLE>
</HEAD>

<BODY>
<% out.println(request.getParameter("name"));%>
<H1>We can read hidden fields</H1>
The hidden text is: 
<% out.println(request.getParameter("hidden")); %>
</BODY>
</HTML>

The output of the program is given below:

After adding the name the output will be.

Download this example.


 

                          

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

3 comments so far (
post your own) View All Comments Latest 10 Comments:

Say a page uses the hidden field to store your session. If you want to read that hidden field in java how is this done?

Posted by Me on Saturday, 05.31.08 @ 23:57pm | #61606

The site is containing a lot of information and it is excellent !!

Posted by shri on Wednesday, 03.5.08 @ 11:58am | #51403

I m newbie and tring to learn hidden form fields session management...but its seems this example is missing with one file SettingHiddenField.jsp can u pls update this page and put that file. Thank you.

Posted by sunny on Friday, 08.24.07 @ 06:34am | #24015

Latest Searches:
form bean
foreach
convert excel to csv i
jboss connection pool
convert byte to char
database
digital clok program i
ASP Miscellaneous Incl
strutes
this keyword in get a
Servlet Example To Dis
clear the console in j
breakà®°?யà®?à®°??à®
Combattons la programm
DynaAction Form
Heap Sort in Java
sั?�?�?ั?�??
html table wrap
Combattons la programm
Photoshop Effects Lase
create a moving banner
web service code
Photoshop Wave effect
readline()
File Java
Photoshop Effects Disp
dynamic table
sql function
CENTER_ALIGNMENT
algorithm for calculat
tiles 2
space char
Linux Caixa Mâ????â?
localization in struts
in-container testing j
delete
can i use one resultse
java telecom domain
??????????????????????
import data to csv fil
getting and setting co
round image Ellipse2D
clientside
Lomboz
jsp login by insertin
Struts 2
java quiz
interface
export database data i
maven
UML basics: The compon
easy struts eclipse
.tld
change color in JTabl
struts 2 submit
collections interview
spring framework
new set
meaning of object in j
html:button jsp exampl
ajax connecting mysql
create a directory and
Action Script 'include
mobile screen
tree component web jav
JDBC
round image
File InputStream
combo box
join
remove spaces from a s
Drools
fireTableCellUpdated
breakаÐ?????аÐ????а
ejp
java application code
activemq
jsp bank examples
?бâ?????бâ????
how to store data in a
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.