In response to the original jsfiddle, please see this version:
http://jsfiddle.net/33PGQ/23/
This changes in three ways: first, at the bottom, for a simple logical value, the equal valid value of both fields is set (then it is warned). Because each call to valid () returns a boolean, you can simply and easily verify that all form elements are correct.
Secondly, the validate parameter is expanded using the special function showErrors, which has no internal code. This function overrides the default behavior for validation errors, so that although the internal validity of the fields can be verified and the validity of the fields is processed, the actual error text is not displayed, thereby allowing all validation rules, but eliminating the display of validation results.
Finally, although it is not explicitly requested in the initial question, I added the optional parameter โonsubmit: falseโ, which overrides the default behavior to verify the correctness of the default to prevent the form from being submitted if all validation rules have not been successfully verified. This can be removed if you want to prevent sending (I assume you will), but I think this is a useful feature to be aware of. I have included it here if you have a special case where you want the form to be submitted, even if the form validation fails.
Of course, it is worth considering the list of options to check; There are many ways you can customize the behavior of the validator according to what you want.
Rob wilkins
source share