php - callback not working in codeigniter 3.0 -
<?php class form extends ci_controller { public function index() { $this->load->helper(array('form', 'url')); $this->load->library('form_validation'); $this->form_validation->set_rules('email', 'email', 'required|valid_email'); $this->form_validation->set_rules('password', 'password', 'required'); $this->form_validation->set_rules('confpassword', 'password', 'required|matches[password]', 'callback__matcherror'); //$this->form_validation->set_rules('passconf', 'password confirmation', 'required'); //$this->form_validation->set_rules('email', 'email', 'required'); if ($this->form_validation->run() == false) { $this->load->view('login'); } else { $this->load->view('insert_dream'); } } public function _matcherror() { $this->form_validation->set_message('_matcherror', 'passwords should match'); return false; } } ?>
i newbie codeigniter. above code doesnt display passwords should match error message. wrong callback or missing something.
take here. don't need make callback.
Comments
Post a Comment