A jQuery plugin that understands HTML5 forms and knows how to validate them, even in browsers that don't yet support HTML5.
http://ericleads.com/h5validate/
In browsers that do support HTML5, h5Validate adds some much-needed features, such as the ability to customize the user interface when an input fails validation.
Uses the new "required" and "pattern" attributes in HTML5 to extract validation rules from your HTML and enforce them.
Very configurable:
Custom CSS class for validation errors.
Custom CSS class to mark a field validated.
An html attribute that stores the ID of the error message container for this element. It's set to data-errorID by default. Note: The data- attribute prefix is a new feature of HTML5, used to store an element's meta-data. e.g.
<input id="name" data-errorID="nameError" required >
A list of CSS selectors for attaching keyboard-oriented events. Default:
kbSelectors: ':text, :password, select, textarea'
(Events) These are the "keyboard oriented" events. Better to think of them as non-mouse-specific events. Set them to "true" if you want them to trigger a field validation. Defaults:
focusout: true,
focusin: false,
change: false,
keyup: true
A list of CSS selectors for attaching "mouse oriented" events. Default:
mSelectors: ':radio, :checkbox, select, option'
(Event) The only default mouse-oriented event. Since it probably makes little sense to trigger validation on other mouse events, I'll leave it to you to figure out how to enable them.
Note: The click event isn't just for the mouse. It will trigger for keyboard and touch screen interactions, too.
click: true
(Event) Set true to trigger validation on submit. Submit needs a special handler, because it needs to check that all fields are valid, optionally save data, and optionally submit the form. Will have Ajax, get, and post. Default:
submit: true
A library of pattern expressions that you can attach with the class attribute, instead of embedding the same pattern many times in your markup. This is good, because you might want to re-use a pattern, and there's only one bug to fix if the pattern needs to be fixed later. Sure beats search and replace!
Error messages to display. This is here so that you can easily swap them out. You might want to write your own error messages, or provide language translations.