[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');
}