I have two problems with checking and unchecking (select and deselect all) a checkboxlist:
- The parent checkbox does not check/uncheck.
- I need to only select the children.
Example:
http://jsfiddle.net/TheFiddler/v6wmV/,
$(document).ready(function(){
$('.all').toggle(
function() {
$('.check').find('input[type=checkbox]').attr('checked', true);
},
function() {
$('.check').find('input[type=checkbox]').attr('checked', false);
});
});
Right now, I have the event on a class, and since the class is shared by both checkbox lists, they all toggle.