SQL PHP HTML JavaScript articles and free code If you are facing any problem in viewing this page, please tell us
 

Hidden HTML form field to pass data


Hidden fields are similar to text fields except one difference i.e, hidden fields are not actually shown to the user (i.e, they will be hidden from the user). User cann' type anything into the hidden field. This is mainly used to submit some information which cannot be edited by the user.

Some examples of hidden filed uses are: customer id, page id, visitor referrer etc. Sensitive information are not kept in hidden fields. The data stored in hidden fields can be collected by server side script like any other form filed data.

Hidden field can be created as :

<input type="hidden" name="<Name of the field>" value="<Default value of the object>">


Attributes of Hidden Field

Name:This attribute specifies the name of the object through which it can be referenced.
Value:Specifies the value of the hidden field.

Example:

<input type="hidden" name="hidfield" value="Cart ID ">

This places a hidden field within the HTML form, which can be referenced by using its name "hidfield" and whose value is "Cart ID ". Hidden field name and value are submitted to the server just as any other text field except that the field will not be visible to the user.

Note:

If the user sees the viewsource, then he/she can find the hidden field.

Form Fields  | Text Field  | Hidden Field  | Password Field  | TextArea  | RadioButton  | Checkbox  | Button  | Image Button  | Submit Button  | Two Submit Buttons | Submit new window  | Reset Button  | Drop-Down Menu
Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked

Sections
PHP
JavaScript
ASP
HTML
SQL
Photoshop
Articles SEO
List of HTML Tutorial
<Form>
HTML Tags
HTML Calendar
Tags on web page
Web Design
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.