LinuxGeex.Myhosting.Info: Using the jQuery Validation Plugin, with working example.
Articles Using the jQuery Validation Plugin, with working example. Feb 1st 2012

Client side validation is a whiz with the jQuery Validation plugin.

Here's a simple example with some defaults specified in the script section at the bottom of the page source.

Basically, design your form as usual, but bear in mind to keep enough room around your elements for the error notifications. Define your valid datatypes using the type attribute. Some additional features can be enabled by adding certain classes, such as "required". See the docs for more information.

I will expand this demo later with some additional features not found in the stock validation plugin. In particular, the ability to have a descriptive message in the form fields themselves which disappears on focus and reappears when the field is blank, and optionally a popup describing the errors instead of the notices outside the form fields.

Validating a form with the jQuery Validation Plugin

Our policy:

And that's all there is to it =)

Powered by jEdit 4.3.2, the Programmer's Editor. Powered by SiteWrapper 1.0.1, the ultralight PHP CMS. Powered by LG Solutions, the web design professionals