Page 1 of 1

Syntax reference on validator types, e.g. rangelength

PostPosted: Wed Apr 16, 2008 1:20 pm
by marksawers
I haven't been able to find reference material on the syntax for all validation types. For example, how do I use the rangelength? I tried validators:rangelength = 1,100 and 1-100 but neither works.

Thanks!

PostPosted: Wed Apr 16, 2008 2:05 pm
by shannah
Try putting it in quotes (comma separated):

Code: Select all
validators:rangelength = "1,100"

Syntax reference on validator types, e.g. rangelength

PostPosted: Wed Apr 16, 2008 2:16 pm
by marksawers
Quotes didn't work. Tried this:

Code: Select all
validators:rangelength="1,100"
validators:rangelength:message="Class must be between 1 and 100"

PostPosted: Wed Apr 16, 2008 2:30 pm
by shannah
Not sure why its not working.

You can achieve the same thing using the regex validator:

Code: Select all
validators:regex = "/^.{1,1000}$/"