Register a callback which will check whether all the checkboxes in the current group is checked or not
$('input[id^=checkall]').click(function(){
$(this).closest('fieldset').find('input').not(this).prop('checked',this.checked);
});
$(':checkbox').not('[id^=checkall]').click(function(){
var all = $(this).closest('fieldset').find('[id^=checkall]');
var chks = $(this).closest('fieldset').find('input').not(all);
all.prop('checked', chks.length == chks.filter(':checked').length);
})
Demo: Fiddle
solved Group checkboxes in JSFiddle: Part2 [closed]