[eluser]Juan Velandia[/eluser]
Hello everyone, I would like to ask for your help. I have created a form created from records in a data base table named ITEMS
The view:
Code:
echo form_open('item/print');
foreach ($items as $item)
{
echo form_checkbox($item->id_item, $item->name_item);
}
echo form_submit('submit', 'Submit selected items');
echo form_close();
I check some of the check boxes that I want and send the form to the controller:
The controller
Code:
$post = array();
foreach ( $_POST as $key => $value )
{
$post[$key] = $this->input->post($key);
}
print_r($post);
The problem is that I need to put into the $post array ONLY the values $item->id_item of the selected items in the form, but I also get the SUBMIT value within the array
What can I do, I dont want to use a if(!$key==submit) within the loop. Any ideas or previous thread will be highly appreciated!