We use the small, but still very flexible Validate.js library. Below are working examples of basic validation techniques for commonly-used form field types.
More Information in the WCAG 2.0 Guidelines
Use HTML 5 Input Types
When you use the appropriate input
type on an input, modern browsers will do basic client-side validation (and older browsers will handle it just fine). Modern browsers will also provide useful controls for users.