Is there a way of assigning the value of a checkbox as an array.
I have a load of checkboxes, one of which is an all option. I would like to set the value of this to an array?
I have tried creating an array of ints (ids) from an array of my objects using a simple loop and then using print_r in the value (I know this is a bit ugly and I can see why this wouldn't work but can't seem to find the correct syntax).
$arrAllID = array();
foreach ($AvailableGroups as $objASRDCallBackGroup)
{
$arrAllID[] = $objASRDCallBackGroup->m_iGroupID;
}
<input id="group-name" value="<?php print_r($arrAllID) ?>" name="SelectedGroups[]" type="checkbox">All
Also I could design around this and do the retrieval of the collection when the form is posted by checking if all was selected or something but I would really like to know how you can do this now..
Any help greatly received.
Thanks