[eluser]tatacarrera[/eluser]
Well this is my first post in this forum, so here it goes:
I have something like this
Code:
function user() {
$this->load->model('category');
$this->load->model('post');
$this->load->library('form_validation');
$this->form_validation->set_rules('user', 'name', 'required|xss_clean');
$this->form_validation->set_rules('post', 'post', 'required|max_length[200]');
if ($this->form_validation->run() == FALSE) {
$data['categories'] = $this->category->getCategoriesArray();
$data['posts'] = $this->post->getPostArray();
$this->load->view('creation_form', $data);
} else {
/*some other code*/
}
}
the two functions getCategoriesArray and getPostArray returns arrays for using the 'form_dropdown()' function in the 'creation_form' view, at the first page load, everything is fine, but when I input some bad data, the 'creation_form' is intended for reload but the data passed to the view dissapears. This result into a 'form_dropdown' error because the system can't locate the variables $categories and $posts
It's not posible to pass some variables twice into a form?