Chapter 9: Forms, User Input, and the Common Gateway Interface
203
rows and cols to indicate the size of the resulting text field with units in characters. The wrap
attribute specifies that the text the user enters wraps automatically when the user reaches the right margin. The <textarea> tag is a paired tag, partnered by </textarea>. Any text between the two tags is displayed as the default information in the text box. You saw this demonstrated with the e-mail feedback form earlier, but now I create a more complex form to show you how things can work together. As it turns out, I am building a form for a Web site I’m working on, so I’ll step through this form design to show how to utilize a textarea field, as well as a number of other elements: <h2>Contact The School</h2>
<form method=”get”
action=”http://www.intuitive.com/coolsites/cgi/query.cgi”>
Name: <input type=”text” name=”fullname” />
<br />
Address: <input type=”text” name=”address” size=”60” />
<br />
Phone: <input type=”text” name=”phone” />
<br />
Email: <input type=”text” name=”email” />
<br />
Your child is in
<select name=”child1”>
<option selected>(please choose one)</option>
<option>pre-kindergarten</option><option>Kindergarten</option>
<option>First</option><option>Second</option><option>Third</option>
<option>Fourth</option><option>Fifth</option><option>Sixth</option>
<option>Seventh</option><option>Eighth</option><option>Ninth
</option><option>Tenth</option><option>Eleventh</option>
<option>Twelfth</option><option>(not applicable)</option>
</select>
<br />
<input type=”checkbox” name=”sendInfo”> Please send
me an information packet on the school.<br />
<input type=”checkbox” name=”thisYear”> I’m
interested in learning about enrollment opportunities
for this school year.
<br />
<input type=”submit” value=”Submit Query” />
</form>
Figure 9-4 shows the preceding form in a Web browser. This is a rudimentary form, but you can do quite a bit to jazz it up. You’ll learn how to do just that in the next section.