Welcome Guest, Not a member yet? Register   Sign In
Form Validation and password change?
#5

[eluser]Treeda[/eluser]
Hi Jedd,

i think with normal rules you can't do that.

Sure i didn't used post directly.

heres a snippet what i currently doing (see the addtional required flag)

Code:
$this->form_validation->set_rules('pass1', 'Neues Passwort', 'trim|min_length[6]|max_length[20]|xss_clean');
            $this->form_validation->set_rules('pass2', 'Neues Passwort (Wiederholung)', 'trim|min_length[6]|max_length[20]|matches[pass1]|xss_clean');

            $this->form_validation->set_rules('email', 'E-Mail', 'trim|valid_email|callback_check_email|xss_clean');
        }

        //there is a special situation!!!
        //if the user enters a new password there has to be some different rules
        if ( $this->input->post("pass1") ){
            $this->form_validation->set_rules('pass', 'Aktuelles Passwort', 'trim|required|min_length[6]|max_length[20]|callback_check_password|xss_clean');
            $this->form_validation->set_rules('pass2', 'Neues Passwort (Wiederholung)', 'trim|required|min_length[6]|max_length[20]|matches[pass1]|xss_clean');
        }


Messages In This Thread
Form Validation and password change? - by El Forum - 03-14-2009, 03:03 PM
Form Validation and password change? - by El Forum - 03-14-2009, 03:07 PM
Form Validation and password change? - by El Forum - 03-14-2009, 03:10 PM
Form Validation and password change? - by El Forum - 03-14-2009, 03:36 PM
Form Validation and password change? - by El Forum - 03-14-2009, 04:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB