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

[eluser]rogierb[/eluser]
I think the validation library provides the values for get_value(). So it need to be loaded.

So you could try something like
Code:
function add()
{
     $data = array();

     $this->load->library('validation');
     $rules['name']    = "trim|required|min_length[1]|max_length[12]|xss_clean";
     $rules['assigned_id']    = "trim|required|";
     $this->validation->set_rules($rules);

     if ($this->validation->run()){
         $this->db->insert('locations',$data);
         redirect('/locations/index/');
     } else {

         $this->template->write_view('content','locations/add',$data);

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


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



Theme © iAndrew 2016 - Forum software by © MyBB