Really easy field validation from Dexagogo has implemented a solid form validation API. The basic method is to attach to the form’s onsubmit event, read out all the form elements’ classes and perform validation if required. If a field fails validation, reveal field validation advice and prevent the form from submitting.
The validator also avoids validating fields that are hidden or children of elements hidden by the CSS property display:none. This way you can give a field the class of ‘required’ but it’s only validated if it is visible on the form. The demo illustrates this.
Requirements: Any Modern Browsers with Javascript Enabled
Demo: http://tetlaw.id.au/upload/dev/validation
License: MIT License
