If I have groups of checkboxes like so:
<input type="checkbox" name"checkboxes1" value="#value1">
<input type="checkbox" name"checkboxes1" value="value2">
<input type="checkbox" name"checkboxes1" value="#value3">
<input type="checkbox" name"checkboxes2" value="value1">
<input type="checkbox" name"checkboxes2" value="#value2">
<input type="checkbox" name"checkboxes2" value="#value3">
Is there an easy way in jquery to return a value of 1 for each group of checkboxes, if both of the following conditions apply:
- All of the checkboxes in the group that start with a # in their value are checked
- All of the checkboxes in the group that don't start with a # in their value are not checked
Note: the names of the checkboxes are dynamically generated, so there could be any number in a group, any number of groups and each group could have any name.
Thanks :)