Chapter 5

Getting Valid Input

In This Chapter

arrow Extracting data from drop-down lists

arrow Working with multiple-selection lists

arrow Getting data from check boxes and radio groups

arrow Validating input with regular expressions

arrow Using character, boundary, and repetition operators

arrow Using pattern memory

Getting input from the user is always nice, but sometimes users make mistakes. Whenever you can, you want to make the user's job easier and prevent certain kinds of mistakes.

Fortunately, you can take advantage of several tools designed exactly for that purpose. In this chapter, you discover two main strategies for improving user input: specialized input elements and pattern-matching. Together, these tools can help ensure that the data the user enters is useful and valid.

Getting Input from a Drop-Down List

The most obvious way to ensure that the user enters something valid is to supply him with valid choices. ...

Get HTML5 and CSS3 All-in-One For Dummies, 3rd 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.