Welcome Guest, Not a member yet? Register   Sign In
Form Validation - checking integer values (greater than, less than)
#1

[eluser]thbt[/eluser]
There must be an easy way to check if integer values are within range... something like

$rules['amount'] = "trim|required|min_val[5]|max_val[12]";

Anyone know an easy way to do this?
#2

[eluser]Phil Sturgeon[/eluser]
You just need to extend the Validation class (as it looks like you are using it over the new 1.7 Form Validation class, even though the idea is the same).

We had a wiki page for collecting our validation extensions, that seemed to vanish. Here is one of my old posts about it.

Post: Less Than, Greater Than, Equal to in Validation
#3

[eluser]Phil Sturgeon[/eluser]
Ahh here we go.

There is LOTS more on here than you will need, but some of them may be handy.

Wiki: MY_Validation
#4

[eluser]thbt[/eluser]
Nice, I like. Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB