![]() |
Problem when updating the user data form - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Problem when updating the user data form (/showthread.php?tid=72406) |
Problem when updating the user data form - morter - 12-15-2018 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 RE: Problem when updating the user data form - php_rocs - 12-16-2018 @morter, You will need to either take the unique portion out or create a custom call back function that is able to handle the email during an user account edit/update. |