CodeIgniter Forums
Form Validation (greater_than, less_than) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Form Validation (greater_than, less_than) (/showthread.php?tid=41700)



Form Validation (greater_than, less_than) - El Forum - 05-14-2011

[eluser]xerosis[/eluser]
In the CI guide:
http://ellislab.com/codeigniter/user-guide/libraries/form_validation.html

We have two rules (greater_than, less_than) but they seem to not be working.

Not only are they not working but in the Language section there is also nothing created for them.

How come? How can I get them to work?


Form Validation (greater_than, less_than) - El Forum - 05-17-2011

[eluser]toopay[/eluser]
To get some "cool" feature, you may want to use Reactor instead Core. For example, in latest commit (by Phil) at Form_validation class, now it allow you to add 'is_unique' as validation rule.


Form Validation (greater_than, less_than) - El Forum - 05-22-2011

[eluser]Unknown[/eluser]
I don't know what you mean when you say they don't work, but I came across this:

Quote:greater_than Returns FALSE if the form element is less than the parameter value or not numeric.

Going by the description one has to resort to guessing/trying what happens when the form element is exactly the parameter value.

I'd like to propose the description becomes

Quote:Returns FALSE if the form element is less than or equal to the parameter value, or not numeric.



Form Validation (greater_than, less_than) - El Forum - 06-06-2011

[eluser]Unknown[/eluser]
[quote author="AboutToRewind" date="1306072839"]I don't know what you mean when you say they don't work[/quote]

he means they always return true. I have a project where I need to use one, and it does not appear to work. it never returns a validation error.

looking at the source code for the Form_validation library, there are no less_than or greater_than functions, while there are functions corresponding with all the other validation rules.


Form Validation (greater_than, less_than) - El Forum - 06-06-2011

[eluser]cideveloper[/eluser]
[quote author="xerosis" date="1305420637"]Not only are they not working but in the Language section there is also nothing created for them.[/quote]

CI 2.0.2 change log shows Added form_validation_lang entries for decimal, less_than and greater_than.

2.0.1 Added decimal, less_than and greater_than rules

What version are you using?