Run individual validation scripts? - Validation Library |
[eluser]WoolyG[/eluser]
Hi, Is it possible to run individual validation against a specified rule? eg: Code: $rules['register_firstname']="required|xss_clean"; Cheers WoolyG
[eluser]Dennis Rasmussen[/eluser]
From the Documentation: http://ellislab.com/codeigniter/user-gui...ation.html You set the rules with the set_rules method and as you can see in the documentation you can add as many rules for as many fields as you like - individually. Code: $this->load->library('form_validation');
[eluser]WoolyG[/eluser]
I understand that, but I want to individually state why each POST value is failing the validation in my return. I'm not loading a view from the results of the POST, I'm setting session values and redirecting, and as a result the form_error() functions are not displaying on my redirected pages.. WoolyG
[eluser]CroNiX[/eluser]
You can also just store the validation errors in session and view them after the redirect.
[eluser]Dennis Rasmussen[/eluser]
You can get individual errors with the form_error() function. Documentation: http://localhost/CodeIgniter Doc/librari...dualerrors Code: foreach($_POST as $key => $value) Something like that? I don't see the point of it though, but if that's what you need then so be it |
Welcome Guest, Not a member yet? Register Sign In |