Form Use
Forms are used to send information between the user and the site. With forms the user can send information in text boxes, radio button and check box choices, and even upload files.
Forms were not originally part of the HTML spec, but were added early on to all communication.
Without forms, e-commerce wouldn't be possible, as no one could select a product, and checkout. Forget personalized web sites like Facebook or MySpace, as you couldn't write on someone's wall, or post a bulletin, or even sign in.
It is virtually limitless what you can do with a form with a little fore thought.
Form Processing
Forms must have their information processed however. This is usually done with a form processor written in something like PHP, ASP/ASP.Net, etc.
In some cases you can have form information mailed to someone by adding a mailto: to the action attribute (more on that in a minute), but it requires the user have a mail clients like Thunderbird, Eudora, or Outlook installed. Web based mail like Yahoo!Mail, Gmail, etc, will not work for the mailto: forms.
Form Creation
First you should add form tag. The form tag has several attributes which will allow you to modify how the form works.
- name - used if you are using JavaScript to modify the tags
- action - the location (URL) of the form processor
- method - how information will be sent from one location another
- get - the form information is placed into the URL of the processor.
ex: http://access2learn.com/form.php?name=walter+wimberly
This also runs the risk of making the URL too long, as URLS can only be 4,000 characters total.
It also makes things like passwords unsafe as they are posted in clear view to anyone look over the shoulder - post - the form information is placed into the http headers so they aren't seen by people.
- get - the form information is placed into the URL of the processor.