![]() |
Form validation running multiple groups of rules - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Form validation running multiple groups of rules (/showthread.php?tid=27532) |
Form validation running multiple groups of rules - El Forum - 02-13-2010 [eluser]greedyh4mster[/eluser] Hiya! I have several forms. I am using form_validation to store all my rules across all forms. However, I face a problem displaying all the validation errors. This is what is inside form_validation Code: $config = array( Here is my controller calling the form. Code: if($this->form_validation->run('login') && $this->form_validation->run('register')){ In my view for the registration form, I have: Code: echo validation_errors(); But it is only echoing out the errors for the rule set: 'auth', but not the errors for the rule set: 'register'. Please assists. Form validation running multiple groups of rules - El Forum - 02-17-2010 [eluser]greedyh4mster[/eluser] Is there anyone who can help with this? Like having a standard arrays containing all validation rules, but capable of serving for multiple forms? Form validation running multiple groups of rules - El Forum - 02-17-2010 [eluser]maria clara[/eluser] instead of Code: if($this->form_validation->run('login') && $this->form_validation->run('register')){ try Code: if ($this->form_validation->run('login')) try to have separate if condition for both validation error Form validation running multiple groups of rules - El Forum - 02-28-2010 [eluser]greedyh4mster[/eluser] It seems like the first $this->form_validation->run() is able to run through the validation rules set. However the second $this->form_validation->run(), is always true even when the data entered by the user is obviously wrong. Anyone has a solution for running $this->form_validation->run() multiple times for a single form? |