Welcome Guest, Not a member yet? Register   Sign In
issue with re-populating the field values after form validation
#7

[eluser]Mithun[/eluser]
That's correct, I removed all reference to deprecated validation class and it worked
Code:
function add()
{
     $data = array();
    
     $this->load->library('form_validation');

     $this->form_validation->set_rules('name', 'Name', 'trim|required|min_length[1]|max_length[12]|xss_clean');
     $this->form_validation->set_rules('assigned_id', 'AssignedId', 'trim|required');
     $this->form_validation->set_rules('address', 'Address', 'trim');

     if ($this->form_validation->run()){
         $this->db->insert('locations',$data);
         redirect('/locations/index/');
     } else {
         $this->template->write_view('content','locations/add',$data);

     }
     $this->template->render();
}

Thanks rogierb, Thanks noctrum.


Messages In This Thread
issue with re-populating the field values after form validation - by El Forum - 01-21-2010, 09:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB