O'Reilly logo

Sams Teach Yourself CGI in 24 Hours, Second Edition by Rafe Colburn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Workshop: Building an Entire Form

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.

Listing 5.1. survey.html, A Sample Survey Form
 1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 2: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required