this.is(":checked") not working
<p>I'm using the following code to loop through all the checkboxes in my form.  The boxes are gerenated dynamicaly from a php script so I won't know the names or the number of check boxes. </p>

<p>I need to find out which checkboxes have been ticked so I only pass those ones to the php script that handles the form.</p>

<pre><code> $("#panelform input:checkbox").each(function () {
    if(this.is(":checked")){
    fields = fields+"&amp;"+this.name+"="+this.value;
}
});
</code></pre>

<p>When the script gets to the this.is(":checked") it errors but being jquery my console doesn't show me any error messages just stops. </p>

<p>if I alert or console.log "this" after the first line I get the form field so I know that that much works. </p>
