Unique Check in Codeigniter::
$this->form_validation->set_rules('email', 'email', 'trim|required|valid_email');
//Customized Unique Check::
if($this->input->post('user_name') != $original_value) {
$is_unique = '|is_unique[users.user_name]'
} else {
$is_unique = ''
}
$this->form_validation->set_rules('user_name', 'User Name', 'required|trim|xss_clean'.$is_unique);
$this->form_validation->set_rules('email', 'email', 'trim|required|valid_email');
//Customized Unique Check::
if($this->input->post('user_name') != $original_value) {
$is_unique = '|is_unique[users.user_name]'
} else {
$is_unique = ''
}
$this->form_validation->set_rules('user_name', 'User Name', 'required|trim|xss_clean'.$is_unique);
No comments:
Post a Comment