Welcome Guest, Not a member yet? Register   Sign In
Form validation rule question
#2

[eluser]CroNiX[/eluser]
Yes, rules are processed left to right.
Yes, rules like "trim", otherwise known as a "prepping function" do alter the values as they manipulate the data and return it. If a function returns a value other than a boolean TRUE/FALSE, that value will be the new value and the rule is assumed to "pass". If you return a TRUE, the rule passes, return FALSE and it doesn't.

Please read the [urlhttp://ellislab.com/codeigniter/user-guide/libraries/form_validation.html#preppingdata]Prepping Data section[/url] of the Form Validation library for more info.
Quote:Note: You will generally want to use the prepping functions after the validation rules so if there is an error, the original data will be shown in the form.


Messages In This Thread
Form validation rule question - by El Forum - 07-25-2012, 04:54 PM
Form validation rule question - by El Forum - 07-25-2012, 05:48 PM
Form validation rule question - by El Forum - 07-25-2012, 06:41 PM
Form validation rule question - by El Forum - 07-25-2012, 07:00 PM
Form validation rule question - by El Forum - 07-25-2012, 07:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB