Designing Easily Validated Forms
You can ease the burden of form validation by writing forms that require less effort to validate. You should design your form fields so that they give the user few opportunities to make mistakes. Let me provide you with a few examples.
When you have a form that contains a field for the U.S. state, you should create a pull-down list of states that the user selects from rather than placing a text field on the page and allowing the user to enter his state abbreviation. Restricting the user to only valid options eliminates typing errors, even though it makes data entry a bit slower for experienced users. Any time you create a field that has a restricted set of options, you should use a select box or a group of radio ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access