Chapter 14. Creating validation rules

This chapter covers

  • The jQuery Validation plugin
  • Adding validation rules

Although not part of jQuery itself, the Validation plugin from Jörn Zaefferer is a widely used plugin that has its own extension point (http://jqueryvalidation.org). The plugin helps to ensure that only valid data is sent to the server when a form is submitted, avoiding unnecessary requests that would only result in a user-correctable error, such as missing required fields or incorrectly formatted email addresses.

The built-in rules provided by the plugin include required for mandatory fields, digits or number for numeric input, min and max for minimum and maximum values, email and url for email address and URL formats, and

Get Extending jQuery 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.