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

[eluser]bpdp[/eluser]
hello everyone,
I have something like this:
Code:
$this->form_validation->set_rules('password', 'Password', 'trim|required|callback_correct_creds');
$this->form_validation->set_rules('email', 'Email', 'trim|required|callback_is_confirmed');

which currently kinda works but not exactly what I would like. right now I have a callback to check to see if the username and password combo is legit, and another call back to make sure that they have confirmed there email. both work as expected but if the email is entered wrong both errors are triggered. I was wondering if there was a way to do something like:
Code:
if($this->form_validation->set_rules('password', 'Password', 'trim|required|callback_correct_creds'))
{
    $this->form_validation->set_rules('email', 'Email', 'trim|required|callback_is_confirmed');
}

Thanks in advance


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