Welcome Guest, Not a member yet? Register   Sign In
Validating many rules groups in the same controller
#1

[eluser]Agustín Villalba[/eluser]
Hi there! I have a problem. I need to validate different groups of rules in the same function in the same controller. I have this code:
Code:
if($this->form_validation->run('group1') != FALSE)
        {
            if($this->input->post('var') !== FALSE)
            {
                if($this->form_validation->run('group2') != FALSE)
                {
                    $this->_process_form();
                    return;
                }
            }
        }
I have defined both groups of rules (group1, group2) in the file config/form_validation.php, but the first execution of $this->form_validation->run('group1') runs ok, but the second one $this->form_validation->run('group2') always returns 1, even if I leave all the fields blanks. What I do worng?? Thank you!




Theme © iAndrew 2016 - Forum software by © MyBB