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.
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. With something so important, you would think that there was tons of thought put into form tags and how they work.
However, forms were not originally part of the HTML spec, but were added early on to all communication. Unfortunately, for many years they were left unchanged. This means that we still suffer from a lack of technology updates that other parts of the HTML specification got. Luckily in HTML5, there has been a lot of improvement to the way forms fields can be chosen and used.
It is virtually limitless what you can do with a form with a little fore thought. Now with CSS and HTML5 we can build and style forms into a multitude of manners.
Forms must have their information processed however. This is usually done with a form processor written in something like PHP, ASP/ASP.Net, Python, Ruby, etc. Each server is set up differently, and while most servers support one or more server languages, it is unlikely that they would support all. Therefore, we will not look at server side languages.
If you want, you can look ahead to the An Introduction to PHP notes, to get a brief idea of a type of server side language.
Sending results via email
You can have form information emailed 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. Unfortunately not everyone has an email client on their machine. (Think about the lab computers.)
Additionally spammers can read web pages now, and find email addresses, even if they are not visible to the end user, like those in a mailto link or form action. This means you are increasing the chances of you getting unwanted spam.
Several examples for forms can be found here: http://www.smashingmagazine.com/2006/11/11/css-based-forms-modern-solutions/