This bit of jquery javascript checks a set of checkboxes with one click
<script type="text/javascript">
jQuery.fn.checkAll = function(name,flag){
var selector = ':checkbox'+(name?'[@name='+name+']':'');
$(selector,this).attr('checked',flag);
}
</script>
the inputs
<input type="button" value="Select all " onclick="$('#formname').checkAll('', 1);"/>
<input type="button" value="Deselect all" onclick="$('#formname').checkAll('', 0);"/>
- should be easy to adapt
You'd be better off with array based names - it won't validate for one