You are here: Reference > HTML > tags > input:hidden

input:hidden element

Browser support:
Creates a hidden text control.
The control is not rendered, and it is invisible for the user. With this element you can send hidden data with a form to a server.
This control is one of the form controls.
The contents of the control can be submitted to a server if the following conditions are met:
  • A form element must contain the hidden control.
  • The action attribute of the container form must be set to the URL of the server.
  • The name attribute of the hidden control must be specified and non-empty.
When the container form is submitted, the name and the text content of the hidden control are sent as a name/value pair.
If you want to see the HTML tags by categories, please visit this page.
This element cannot have a closing tag.
JavaScript page for this element: input:hidden.

Possible members:

Sets the style class or classes that belong to the element.
Specifies which field of a given data source should be bound to the specified object.
Sets the identifier of the data source that is bound to the element.
Specifies whether a dotted rectangle (focus rectangle) is drawn around an object while it has focus.
Sets a unique identifier for the object.
Specifies the language of the element.
Sets the scripting language for the current element. Use it only for the script element.
Sets the name of a form control that affects the contents of the message submitted to the server.
Sets an inline style associated with an element.
Sets the type of the input element.
Sets whether the selection process can start in an element's content.
Specifies the initial value for a control element.

Example HTML code 1:

This example illustrates the use of the hidden input element. For example, if you want know how long it takes the user to fill a registration form, simply create a hidden input field with a value of the actual server time when generating the registration form on the server. When the form is submitted, you can get the duration from this value.
<form method="post" action="#URL#">
    <input type="hidden" value="19:03:31" name="startTime" />
    Username: <input type="text" name="userName" />
    <br />
    Email: <input type="text" name="email" />
    <br />
    Password: <input type="password" name="password" />
    <br />
    Repeat Password: <input type="password" name="repassword" />
    <br /><br />
    <input type="submit" value="Register" />
Did you find this example helpful? yes no

Related pages:

External links:

User Contributed Comments

Post Content

Post Content