"Creating Web Pages With HTML - Simplified"
Chapter 9: Pages 126-139

Creating Forms

IDG's 3-D Visual Series

Navigation Bar
Main Table of Contents Previous Chapter Next Chapter

Introduction To Forms Set Up A Form Create A Text Box Create A Large Text Area Create Check Boxes Create Radio Buttons Create A Submit Button Create A Reset Button View Form

	128  Introduction to Forms
» Purpose of Forms
 
  1. Gather Information

  2. Process Information

129 Set Up a Form
  1. Place the following command line where you want the form to appear on your Web page:
    <Form Method=Post Action="/cgi-bin/survey.pl"> </Form>

  2. The CGI script will process the information submitted by the form.
 
Note: To determine the location of the CGI script on your Web server, contact your Web server administrator.

130 Create a Text Box
  1. Between the <Form> tags, type the text you want to appear beside the text box.

  2. Then press the SpaceBar. If you want the text box to appear on its own line, use the P or BR tag.

  3. Type <Input Type="text" and then press the SpaceBar.

  4. Type Name="?" replacing ? with a word that describes the text box.

  5. Then press the SpaceBar.

  6. To define the width of the text box, type Size="?" replacing ? with the width you want to use in characters.

  7. If you want to define the maximum number of characters that readers can enter in the text box, type MaxLength="?" replacing ? with the maximum number of characters.

  8. Type > to complete the text box.

132 Create a Large Text Area
  1. You can create a large text area that allows readers to enter several lines or paragraphs of text.

  2. Between the <Form> tags, type the text you want to appear beside the large text area.

  3. Type <TextArea and then press the SpaceBar.
    Note: If you want the text box to appear on its own line, use the P or BR tag.

  4. Type Name="?" replacing ? with a word that describes the text area. Then press the SpaceBar.

  5. Type Rows="?" replacing ? with a height for the text area in rows. Then press the SpaceBar.

  6. Type Cols="?" replacing ? with a width for the text area in characters. Then press the SpaceBar.

  7. Type Wrap> if you want to have the text readers type automatically wrap within the text area.

  8. Type </TextArea> to complete the text area.

134 Create Check Boxes
  1. Between the <Form> tags, type <Input Type="CheckBox" and then press the SpaceBar.

  2. Type Name="?" replacing ? with a word that describes the group of check boxes you want to create. Then press the SpaceBar.
    Note: The text you enter identifies the group of check boxes to the Web server and will not appear on your Web page.

  3. To specify the information for one check box, type Value="?" replacing ? with a word that describes the check box.
    Note: The text you enter identifies the check box to the Web server and will not appear on your Web page.

  4. If you want the check box to be selected automatically, press the Spacebar and then type Checked.

  5. Type > to complete the check box.

  6. Type the text you want to appear beside the check box on your Web page.

  7. Repeat the steps above for each check box you want to create.
    Note: If you want each check box to appear on its own line, use the P or BR tag.

136 Create Radio Buttons
  1. Between the <Form> tags, type <Input Type="Radio" and then press the SpaceBar.

  2. Type Name="?" replacing ? with a word that describes the group of radio buttons you want to create. Then press the SpaceBar.
    Note: The text you enter identifies the group of radio buttons to the Web server and will not appear on your Web page.

  3. To specify the information for one radio button, type Value="?" replacing ? with a word that describes the radio button.
    Note: The text you enter identifies the radio button to the Web server and will not appear on your Web page.

  4. Type the text you want to appear beside the radio button on your Web page.

  5. Repeat the steps above for each radio button you want to create.
    Note: If you want each check box to appear on its own line, use the P or BR tag.

  6. If you want a radio button to be selected automatically, type Checked after the Value attribute for the radio button.
    Note: You can have only one radio button selected automatically.

138 Create a Submit Button
  1. Between the <Form> tags, type <Input Type="Submit" and then press the SpaceBar.

  2. Type Value="?"> replacing ? with the text you want to appear on the Submit button.
    Note: If you want the Submit button to appear on its own line, use the P or BR tag.

  3. When a reader clicks the Submit button, the information they entered in our form will transfer to your Web server.

139 Create a Reset Button
  1. Between the <Form> tags, type <Input Type="Reset" and then press the SpaceBar.

  2. Type Value="?"> replacing ? with the text you want to appear on the Reset button.
    Note: If you want the Submit button to appear on its own line, use the P or BR tag.

  3. When a reader clicks the Reset button, the form clears and once again displays its original settings.

Sample Form
What is your name?
What is your age?    
What comments do you have for this WebSite?
Skier SnowBoarder River Rafting Camping  
Male Female