I have two select boxes: the first contains all avaible items and the second one contains the items I've selected from the first select box.
$items=$this->Database->getItems();
$mySelect=form_multiselect('addedMaterials', $items, '1', 'id="addedMaterials" multiple="multiple"');
To submit all the items from the second select box I've put this:
function selectAll()
{
var selObj = document.getElementById('addedMaterials');
for (var i=0; i<selObj.options.length; i++) {
selObj.options[i].selected = true;
}
}
So now, I go to the controller, where I want to get the items from the box...
$stuff = $this->input->post('addedMaterials');
My problem is that it only gets the last selected item, not all. How can I get all the items of the select box?