Welcome Guest, Not a member yet? Register   Sign In
Form Validation: using set_rules as conditional?
#4

[eluser]CroNiX[/eluser]
Probably something like this would work:
Code:
$this->form_validation->set_rules('password', 'Password', 'trim|required|callback_test');
$this->form_validation->set_rules('email', 'Email', 'trim|required|callback_test2');

public function test()
{
     $this->form_validation->set_message('test', 'Test 1 Error');    
     $this->form_validation->test1 = FALSE;  //set a variable within the form validation that you can check within test2
     return FALSE;
}

public function test2()
{
    $this->form_validation->set_message('test2', 'Test 2 Error');    
    if($this->form_validation->test1 === FALSE)
    {
        //do something
    }
    return FALSE;
}


Messages In This Thread
Form Validation: using set_rules as conditional? - by El Forum - 06-01-2011, 09:39 PM
Form Validation: using set_rules as conditional? - by El Forum - 06-01-2011, 11:51 PM
Form Validation: using set_rules as conditional? - by El Forum - 06-02-2011, 07:16 AM
Form Validation: using set_rules as conditional? - by El Forum - 06-02-2011, 03:16 PM
Form Validation: using set_rules as conditional? - by El Forum - 06-02-2011, 08:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB