ElementAttribute Value
Forms -- Elements & Attributes
Form Action What to do
 Method Post
    Get
  OnSubmit Return javascript function
  Name The name you give the form
Input type Text 
  Radio  
  Checkbox 
  Name 
 Checked Checked
  Value  
  Default 
  Size Length in characters
  Maxlength Maximum number of characters accepted
TextArea Rows Number of rows in height
  Cols Number of columns wide
 Name Name for processing
Select Name Name for processing
  Multiple Determines whether multiple answers may be selected
  Size How many rows may be seen at one time.
Option Value What is passed as data
Submit  Submits the form
Reset  Clears the form

These are some of the different types of input devices you will find on forms. They are the basic devices used to retrieve information from users.

When developing forms you need to be sure to be careful what you ask. Certain information needs to be highly protected. Credit Card Numbers and Social Security Numbers should never be transmitted via e-mail. They should never be used in a form with the get method either. As you will see when we complete a get form the data is visible when a get command is processed.

  1. To build a form, begin with an html page.
  2. Then insert the form element.
  3. Add the action
  4. Add the method
  5. Put in the appropriate fields
  6. Put in a submit button
  7. Put in a clear button
  8. Close the form
  9. Close the html page
  10. Test the form
  11. Check you e-mail.

Remember when you create an e-mail form for users to send you data, the machine where the complete the form must have a default e-mail client set up, if not the e-mail will not work.

Input types

Text --

Generally limited to a few words but can hold several sentences. Usually you would use a textarea for longer answers.

Textarea --

Used when you want to allow a visual indicator that a longer perhaps paragraph type answer is expected. Its size is specified in rows and columns.

Radio Buttons --

Used when you want a single answer from a list of several choices.

Checkboxes --

Used when you want to allow several answers from a list of choices.

Select --

Used when you want the user to be able to select from a list of specific words, commonly seen as a dropdown list. This element may also be used as a multiple select.

OnSubmit --

is a JavaScript event handler that allows you to process the form and evaluate the validity of some of the data before sending the data through thee-mail. We will look at form validation in the final example.

Submit and Reset buttons send and clear the form respectively. As you progress in your abilities you will want to learn PERL so that you can avoid the necessity of using e-mail to send data. By using PERL you can send the e-mail directly from the form and not have to rely on the presence of an e-mail application on the local machine. The issue is you have to be able to execute the PERL commands in a directory on the server; a privilege we do not currently have.