How can i allow 1 to 100 numbers only using validation rules? |
[eluser]suba[/eluser]
Hi all, I want to allow only 1 to 100 numbers only. so how can i set in validation rules?
[eluser]rogierb[/eluser]
There is no standard rule that does this. So you need to create a callback function that checks the number. See http://ellislab.com/codeigniter/user-gui...#callbacks for more information on callbacks. Next to the callback, you can use the 'integer' rule
[eluser]erik.brannstrom[/eluser]
You could do it if you're okay with only values 0 to 99. If you set the validation to "max_length[2]|is_natural" this would make sure you have a natural number (i.e. 0, 1, 2 etc) that isn't longer than two characters, giving you a maximum of 99.
|
Welcome Guest, Not a member yet? Register Sign In |