Creating Hidden Fields

Hidden fields are generated by the processing script to store information gathered from an earlier form so that it can be combined with the present form's data.

To create hidden fields:


Type <input type="hidden".


Type name="label", where label is a short description of the information to be stored.


Type value="data", where data is the information itself that is to be stored. It is often a variable from the form processing script (Figure 17.39).

Figure 17.39. When you create a hidden field, you use the variables from your script to set the value of the field to what the visitor originally entered.


Type />.


  • It doesn't matter where the hidden fields appear in your form since they won't appear in the browser anyway. As long as they are within the opening and closing form tags, you're OK.

  • To create an element that will be submitted with the rest of the data when the visitor clicks the submit button but that is also visible to the visitor, create a regular form element and use the readonly attribute (see page 280).

HTML, XHTML, & CSS(c) Visual QuickStart Guide
HTML, XHTML, and CSS, Sixth Edition
ISBN: 0321430840
EAN: 2147483647
Year: 2004
Pages: 340

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: