Syntax reference on validator types, e.g. rangelength

Archived from the Xataface Users forum.

marksawers — Wed Apr 16, 2008 1:20 pm

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!


shannah — Wed Apr 16, 2008 2:05 pm

Try putting it in quotes (comma separated):

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

marksawers — Wed Apr 16, 2008 2:16 pm

Quotes didn’t work. Tried this:

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

shannah — Wed Apr 16, 2008 2:30 pm

Not sure why its not working.

You can achieve the same thing using the regex validator:

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