Validatious 2.0

Easy form validation with unobtrusive JavaScript

Enable validation on a form

Creating validation rules has no effects unless you connect them to a form. This can be done through two methods, depending on the desired effect. Both of these methods accept one or more validation rules:

validateAll(rule1, rule2, rule3, ...);
validateAny(rule1, rule2, rule3, ...);

You should only call one of these methods, and only once per form. In addition to the two above, validateAll is aliased as validate. validateAll and validate requires all its arguments to pass validation, validateAny only requires one of them to pass.

validate(rule1, rule2, rule3, ...);

Next: Add validators to fields | Back to DSL features index

© 2008 Christian Johansen. Validatious is licensed with a BSD License, documentation and site content with CC Attribution-Share Alike. About.