O'Reilly logo

jQuery Essentials by Troy Miles

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Validation

So far, we've learned how to hook form events, how to provide modern browser features like placeholder and tooltips to older browsers, and how to use jQuery form methods to gather all of our form data. But we are not doing something really important: validating the data.

Validation is important both for the user and for us as the site's creators. For users, validation can be used to let them know how to correctly fill out the form. We can gently nudge them when they make a mistake instead of allowing them to submit a bad form and telling them afterwards that the form contained errors. As the site's maintainers, it can be frustrating to find an address in a field that should have a phone number. HTML5 added a lot of validation features ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required