Now you’ve been introduced to all the fields that can be used in an HTML form. At this point, I’m going to talk about how you put these pieces together to create a usable form. Generally speaking, a form consists of more than just a group of fields—those fields need to be labeled, and often some explanation is required in order to help users understand what’s going on.
In this case, I’m going to create a simple survey form, of the kind one might fill out to get a free subscription to a trade magazine. The source code for the HTML form appears in Listing 5.1.
1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 2: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ...