|
这个弹出层验证信息不显示 但是拿出来以后它又是正常错误提示的图2是拿出来后的 图一是个ajax弹出层不会出现验证信息
function create(){
$typeid=$this->uri->segment(3);
$type=$this->db->get_where('news_type',array('type_id'=>$typeid))->row();
$area=$this->db->get_where('network_city',array())->result();
foreach($area as $r){
$m[$r->id]=$r->title;
}
$this->load->view("ajax/c_news_create",get_defined_vars());
}
function post(){
$type_id=$this->uri->segment(3);
$this->load->library('form_validation',$this->rule_post);
if(!$this->form_validation->run()){
return $this->create();
}
$form = $this->form_validation->to_array();
if(!isset($form['type_id'])){
$form['type_id']=$type_id;
}
if(isset($form['timeline'])){
$form['timeline']=strtotime($form['timeline']);
}else{
$form['timeline']=time();
}
$this->model->upload($form);
if(method_exists($this->model,'upfile')){
$this->model->upfile($form);
}
if(!$this->model->post($form,'id')){
return $this->create();
}
$this->userview->success($this->lang->line('item_post_success')
,array('完成'=>"c_news/$type_id"));
}
控制器代码 请大神帮我分析分析 是怎么回事
|
|