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.
<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.
If the user sees the viewsource, then he/she can find the hidden field with value ( hidden data ).