Welcome Guest, Not a member yet? Register   Sign In
Form Validation (greater_than, less_than)
#1

[eluser]xerosis[/eluser]
In the CI guide:
http://ellislab.com/codeigniter/user-gui...ation.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?
#2

[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.
#3

[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.
#4

[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.
#5

[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?




Theme © iAndrew 2016 - Forum software by © MyBB