Yet another type of input is HIDDEN input.


A HIDDEN input is a name/value pair that is returned to you but does not show up anywhere on the web page.

Let's suppose you were a company trying to generate leads for a new product. You have a standard form for gathering information... name, company, phone, products interested in, etc. The only problem is there are 6 slightly different versions of the form in 6 slightly different places. You need to know what's coming from where. What to do?

You could add a HIDDEN input to your forms like so...

<INPUT TYPE="hidden" NAME="LEADFORM" VALUE="Version 1"> ...for the first version
<INPUT TYPE="hidden" NAME="LEADFORM" VALUE="Version 2"> ...for the second version
<INPUT TYPE="hidden" NAME="LEADFORM" VALUE="Version 3"> ...for the third version
And so on and so forth yada yada yada.

By the way, it doesn't matter what the name/value pair in the hidden input is (or any input for that matter). It can be anything you want. This would be a perfectly legitimate HIDDEN input...

<INPUT TYPE=HIDDEN NAME="E" VALUE="Mc^2"> ...You would get back E=Mc^2

HIDDEN inputs are also useful for cgi scripts. For example, many Internet Service Providers have a script you can have your forms sent to. It then spits the form back to you all nice and neat and ready for human consumption. The hidden input tells the cgi script who you are, where to send the parsed data, etc.

An occasionally useful input is the File Upload input. With it your visitors can send you a file right off their hard drive.


When using this type of input, you must use ENCTYPE="multipart/form-data" in your FORM tag. Also be aware that the occasional older browser doesn't support this type of input and that when this input is used in a mailto form, the results can often be unpredictable.

Last on the list are the SUBMIT and RESET buttons.

They really are very simple...

<INPUT TYPE="submit">

SUBMIT of course, sends the data...

...and RESET, clears the form.

<INPUT TYPE="reset">

<< BACK         NEXT >>