Limit a numeric value

PascM

New Member
Hi,

It might be there but i can't find it so excuse my novice question, is there anyway i can limit user input in a field to a range of numbers ?

Regards

Manos
 
If you need to limit to a range of numbers (assuming you mean a "range" as in something like "between 1 and 10"), you'd need either ...

a) Two 'less than or greater' validations, one for the lower bound (set to "greater than"), one of the upper bound (set to "less than").

... or ...

b) a PHP validation that does ...

PHP:
return (int)$data >= 1 && (int)$data <= 10;

... or whatever your lower and upper bounds are.

-- hugh
 
If you take Hugh's code you must use the PHP validation (not less than or greater) and put it in the "PHP code" field (not Condition field).
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top