have been trying to find a solution to this - the closest I got was the JS:
<script type="text/javascript">
function SetAllCheckBoxes(FormName, FieldName, CheckValue)
{
if(!document.forms[FormName])
return;
var objCheckBoxes = document.forms[FormName].elements[FieldName];
if(!objCheckBoxes)
return;
var countCheckBoxes = objCheckBoxes.length;
if(!countCheckBoxes)
objCheckBoxes.checked = CheckValue;
else
// set the check value for all check boxes
for(var i = 0; i < countCheckBoxes; i++)
objCheckBoxes[i].checked = CheckValue;
}
</script>
Which worked if the name of the checkbox was a constant, e.g.:
<input name="LodgeIDPL" id="LodgeIDPL_<?php echo $RepeatSelectionCounter_1; ?>" type="checkbox" value="<?php echo($row_WADAlodges['LodgeID']); ?>" />
Using:
<input type="button" onclick="SetAllCheckBoxes('Insert_Basic_Default', 'LodgeIDPL', true);" value="Select All Products">
<input type="button" onclick="SetAllCheckBoxes('Insert_Basic_Default', 'LodgeIDPL', false);" value="Deselect All Products">
But it doesn't work here because of the RepeatSelectionCounter being part of the name:
<input name="LodgeIDPL_<?php echo $RepeatSelectionCounter_1; ?>" id="LodgeIDPL_<?php echo $RepeatSelectionCounter_1; ?>" type="checkbox" value="<?php echo($row_WADAlodges['LodgeID']); ?>" />
If you knew of a way to get this to work that would a great help.