6. Form Handling

In This Chapter

Select-and-Go Navigation 135

Changing Menus Dynamically 140

Making Fields Required 142

Checking Fields against Each Other 147

Identifying Problem Fields 149

Putting Form Validation into Action 151

Working with Radio Buttons 156

Setting One Field with Another 159

Validating Zip Codes 162

Validating Email Addresses 166

Any time you need to gather information from the users of your Web sites, you’ll need to use a form.

Forms can contain most of the usual graphical interface elements, including entry fields, radio buttons, check boxes, pop-up menus, and entry lists. In addition, HTML forms can contain password fields, shielding the user’s input from prying eyes.

Once the form is filled out, a click on the form’s Submit ...

Get JavaScript: Visual QuickStart Guide, Eighth Edition 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.