O'Reilly logo

HTML5 Data and Services Cookbook by Mite Mitreski, Gorgi Kosev

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

Combining client-side and server-side validation

When dealing with real web forms we usually need to do various kinds of validation on multiple fields. Some fields may only need checks that can be performed at the client side, while some might also require server-side validation.

In this recipe, we're going to design and implement our own validation plugin that supports asynchronous validation. It will work similarly to jQuery Validate. We're also going to implement some basic validation methods such as required, minLength, and remote.

We're going to use these methods on a simple user registration form, which will be blocked from submission until the user enters valid data in all fields.

Getting ready

The first step in our design process is to design ...

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