Validatious 2.0

Easy form validation with unobtrusive JavaScript

Add validators with parameters

The is method and its aliases accept a second parameter which may be a single value or an array of parameters for the validation. Note that not all validators accept parameters.

"name".has("min-length", 4);

You can also express the above with an array for parameters, however, this only makes sense when the validator accepts more than one parameter. Below is an example of a hypothetical length range validator:

"name".has("length-range", [4, 12]);

Next: Accessing core objects | 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.