jquery: retrieve submitted values for name in array format
<p>on submit, i need to collect the values for a series of checkbox fields with a common name in array format. i tried doing something like:</p>

<pre><code>$('form').submit(function(e){   
  $(':input:checkbox[name=fields[]]', this).each(function(){
    console.log($(this).attr('name'));
    console.log($(this).val);
  });
});
</code></pre>

<p>but the "[name=fields[]]" doesn't restrict the way i think it should.
what i eventually need to do is determine how many checkboxes have been checked from that fields array. i'm just sending to the console log while i figure out the conditions.</p>
