February 2006
Intermediate to advanced
826 pages
63h 42m
English
The form may contain any web content (text, images, tables, and so on), but its function is to be a container for a number of controls (checkboxes, menus, text-entry fields, buttons, and the like) used for entering information. It also has the attributes necessary for interacting with the form-processing program. You can have several forms within a single document, but they cannot be nested, and you must be careful they do not overlap.
When the user completes the form and presses the “submit” button, the browser takes the information, arranges it into name/value pairs, encodes the information for transfer, and then sends it off to the server.
Figure 15-1 shows the form resulting from this simple form markup example.
<h2>Sign the Guestbook:</h2><form action="/cgi-bin/guestbook.pl" method="get">
<p>
First Name: <input type="text" name="first" /><br />
Nickname: <input type="text" name="nickname" /><br />
<input type="submit" /> <input type="reset" />
</p>
</form>