Hello, I´m new for here. I have a problem when updating the user data form, because when the user wants update his data in the form, input email show the error: "Email is already in use", It ´s logic because he hasn´t changed his email in the form and there is a validation rule "is_unique" for the email. Is there any way that this validation rule, Codeigniter ignore it in the user data form?
This is the file with the validation rules of that update form:
function getEditRules() {
return array(
array(
'field' => 'email',
'label' => 'email',
'rules' => 'required|valid_email|max_length[100]|is_unique[user.email]|trim',
'errors' => array('required' => 'Introduce a %s', 'max_length' => 'The %s can´t exceed 100 characters', 'valid_email' => 'The %s is not valid', 'is_unique' => 'The %s is already in use')
),
array(
'field' => 'password',
'label' => 'password',
'rules' => 'required|min_length[6]|matches[password_confirm]|trim',
'errors' => array(
'required' => 'Introduce a %s.', 'min_length' => 'The %s must have at least 6 characters', 'matches'=>'Passwords don´t match
),
),
array(
'field' => 'password_confirm',
'label' => 'password',
'rules' => 'required|min_length[6]|trim',
'errors' => array(
'required' => 'Introduce a %s.', 'min_length' => 'The %s must have at least 6 characters'
)
)
);
}
Thanks you very much