|
如题,直接上图片:
两个错误信息都出来了,我只需要一条错误显示就可以了,求教!
PHP复制代码 //加载表单验证 $this->load->library('form_validation');
//设置验证规则
$this->form_validation->set_rules('username','用户名','required|is_unique[zdts_user.user_name]|alpha_dash|min_length[6]|max_length[18]');
$this->form_validation->set_rules('real_name', '姓名','callback_valid_chinese|callback_cn_min_length[6]|callback_cn_max_length[24]');
$rules_param = array('min_length' => 6,
'max_length' => 18);
$this->set_valid_message($rules_param);
if ($this->form_validation->run() == FALSE){
set_ms (validation_errors ());
redirect ('user/index');
return;
} 复制代码
|
|