Hi Guys!

Im trying to toggle checkboxes on my form with a jQuery function I found. It works, except for the fact the checkbox which I use to select all the other checkboxes does not get checked itself. Any idea why that might be?

Code:

Code:
;(function(d){d.fn.toggleCheckboxes=function(a,b){a=a||"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=!this.checked}).filter(":checked");c=e});if(!b){c=this}return c};d.fn.checkCheckboxes=function(a,b){a=a||"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=true}).filter(":checked");c=e});if(!b){c=this}return c};d.fn.unCheckCheckboxes=function(a,b){a=a||"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=false}).filter(":not(:checked)");c=e});if(!b){c=this}return c};d.radioCheckboxGroup=function(e,a){a=a||"*";var b="input[type=checkbox]";if(e){b+="[name="+e+"]"}var c=d(b).filter(a);c.click(function(){c.not(this).each(function(){this.checked=false}).end()})}})(jQuery);
Code:
<form method="post" action="jobs.php" id="default-form">
<input type="checkbox" onClick="$('#default-form').toggleCheckboxes();" />

<input type="checkbox" name="job[]" value="1" />
<input type="checkbox" name="job[]" value="2" />
<input type="checkbox" name="job[]" value="3" />
</form>