Uncheck group checkbox if at least one in group is unchecked w/jQuery
<p>I have a groups of checkboxes, with one that can check/uncheck the entire group. This functionality should only apply to checkboxed that are not disabled. When I used "main" checkbox to select all and then uncheck one of the checkboxes below, I should also uncheck the main one. However, if I check the one below back, thus making all checked, the "main" should become checked again.</p>

<p>I think I'm over complicating this code:</p>

<pre><code>var checkboxes = $("#myTable input[type=checkbox:enabled]:not(:first)").change(function() {
    var allIsChecked = checkboxes.length === checkboxes.filter(":checked").length;
    all[0].checked = allIsChecked;
});

var all = $("#checkAll").change(function() {
    checkboxes.attr("checked",this.checked);
});
</code></pre>
