Form Creation and Use

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 Examples

A link I found that had several examples for forms: http://www.smashingmagazine.com/2006/11/11/css-based-forms-modern-solutions/

Form Creation

First you should add form tag. The form tag has several attributes which will allow you to modify how the form works.

Adding Elements

Laying out the style of the form is a design decision, and it should be tested against users to determine if it is usable. A couple of things to keep in mind.

  1. Use meaningful labels to describe what the user should input into the form.
  2. Limit the user's choices if possible to ensure accurate data collection. This could be with things like radio buttons, drop-down lists, menu items, etc. Not everything has to be a text box.
  3. Group related items together.
  4. Let people know if something is required.
  5. Align your elements for readability.

There are very few tags actually used in making up forms:

Don't forget the final tag, an input of type "submit". This "submits" the form information to the form processor.

Example, Sample Form 1