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:
$('form').submit(function(e){
$(':input:checkbox[name=fields[]]', this).each(function(){
console.log($(this).attr('name'));
console.log($(this).val);
});
});
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.
$(':checkbox[name="fields[]"]', this)?