Form Validation Toolkit

Sample Form Error Handling Examples

Attach Validation to the Controls

This approach attaches the validation initiation call to each form control. This method should only be used if for any reason, the form should not globally initiate the validation script - i.e. the form has multiple parts, each requiring separate validation.



Please use the following public method of the validation object on form submit when the validation is not attached to the form as in the above example.

@param:onSubmit - Specifies whether this status check is being request on the submission of a form. Set this to true
@param:form - Specifies the form as a jQuery element
$.validator.validateForm.attempt(onSubmit, form);
Click on this button to simulate a form submission with validation check: