Hidden fields allow a coder to pass values to form elements in a subtle manner. An experienced web developer will utilize these fields to pass temporary, or session-based data, from one form to another or to store information that has already been entered in by the user.
Place a hidden input field into your web forms using the <input> tag and set the typeattribute to "hidden". This field can be customized using any of the attributes discussed in theHTML Input and HTML Text Fields lessons.
<form name="myWebForm" action="mailto:youremail@email.com" method="post"> First: <input title="Please Enter Your First Name" id="first" name="first" type="text" size="12" maxlength="12" /> Last: <input title="Please Enter Your Last Name" id="last" name="last" type="text" size="18" maxlength="24" /><br /> Password: <input type="password" title="Please Enter Your Password" size="8" maxlength="8" /><br /><br /> <input type="hidden" name="orderNumber" id="orderNumber" value="0024" /><br /> <input type="submit" value="SUBMIT" /> <input type="reset" value="RESET" /> </form>
First: Last:
Password: