"Creating Web Pages With HTML - Simplified"
Chapter 9: Pages 126-139
Creating Forms
IDG's 3-D Visual Series
128 Introduction to Forms
» Purpose of Forms |
|
- Gather Information
- Process Information
|
129 Set Up a Form
- 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>
- 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
- Between the <Form> tags, type the text you want to appear beside the text box.
- Then press the SpaceBar. If you want the text box to appear on its own line, use the P or BR tag.
- Type <Input Type="text" and then press the SpaceBar.
- Type Name="?" replacing ? with a word that describes the text box.
- Then press the SpaceBar.
- To define the width of the text box, type Size="?" replacing ? with the width you want to use in characters.
- 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.
- Type > to complete the text box.
|
132 Create a Large Text Area
- You can create a large text area that allows readers to enter several lines or paragraphs of text.
- Between the <Form> tags, type the text you want to appear beside the large text area.
- 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.
- Type Name="?" replacing ? with a word that describes the text area. Then press the SpaceBar.
- Type Rows="?" replacing ? with a height for the text area in rows. Then press the SpaceBar.
- Type Cols="?" replacing ? with a width for the text area in characters. Then press the SpaceBar.
- Type Wrap> if you want to have the text readers type automatically wrap within the text area.
- Type </TextArea> to complete the text area.
|
134 Create Check Boxes
- Between the <Form> tags, type <Input Type="CheckBox" and then press the SpaceBar.
- 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.
- 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.
- If you want the check box to be selected automatically, press the Spacebar and then type Checked.
- Type > to complete the check box.
- Type the text you want to appear beside the check box on your Web page.
- 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
- Between the <Form> tags, type
<Input Type="Radio" and then press the SpaceBar.
- 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.
- 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.
- Type the text you want to appear beside the radio button on your Web page.
- 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.
- 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
- Between the <Form> tags, type <Input Type="Submit" and then press the SpaceBar.
- 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.
- 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
- Between the <Form> tags, type <Input Type="Reset" and then press the SpaceBar.
- 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.
- When a reader clicks the Reset button, the form clears and once again displays its original settings.
|
|