Providing Information

We'll start by creating a form for users of the Shelley Web site. This form requires the user to fill out all sorts of personal contact information. It looks like Figure 7-1.

Figure 7-1. Shelley contact form

This form has text fields, checkboxes, and a dropdown menu. We're ignoring radio buttons—it's rare that you need to validate whether a button has been clicked or not, because you can force a button to be selected when the page loads.

In this example, we'll be making sure that all the required text fields are filled in (which is most of them in this case), at least one checkbox is chosen, and an item from the dropdown ...

Get Advanced JavaScript™: Insights and Innovative Techniques now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.