Your Name Here
Internet Services
Question?
Our Products
- Domain Registration
- Hosting Packages
- 50mb Web Hosting
- 100mb Web Hosting
- 200mb Web Hosting
- Micro Web Hosting
- Starter Web Hosting
- Standard Web Hosting
- Pro Web Hosting
Our Features
HTML Tutorial
Chapter 15: Forms Continued
Hidden Fields
Yet another type of input is the 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. The hidden input above is needed for use with Mailto Formatter.
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="hidden tutorial" value="Form 2">
<input type="hidden" name="hidden tutorial" value="Form 3">
By the way, it doesn't matter what the name/value pair in the hidden input is (or any input for that matter). I have just been using "forename" because it saved me some typing. This would be a perfectly legitimate hidden input...
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.
Submit & Reset Buttons
Last on the list are the submit and reset buttons.
They really are very simple...
And reset clears the form...
We can easily change what the buttons say.
If necessary, the submit button can also have a name. You would need this if, for whatever reason, you had more than one submit button.
Next we must tell the browser where to send the data we gather and how to send it. There are two basic things you can do:
- You can send the data to a cgi script for processing, or
- you can have the data E-Mailed to you.
As for the first, whoever wrote the script can tell you how the data should be sent. The second, or mailto form should have the following attributes in the <form> tag.
Note - Microsoft's Internet Explorer 3.0 does not support mailto forms. When you try to submit the information, the new mail message window pops up. Explorer does however support forms sent to a CGI script.
This line is very important. The only thing you have to do is plug in your email address after mailto: The rest must be written exactly as shown. The words form, method, post & action do not have to be capitalized but there must be a space between each attribute.. between form & method, between post & action, and between .com" & enctype.
Unfortunately the data will be sent to you in this 'only useful to a computer' format...
What you'll need is a program to turn it into 'useful to a human' format...
NAME=R.U. Havinfun
ADDRESS=1313 Mockingbird Lane
CITY=Beverly Hills
STATE=CA