I'm using the jQuery Validation plugin.
I have two groups of checkboxes, all with the same name. E.g.
<div>
<input class="category-group-1" type="checkbox" name="category[]" value="a">
<input class="category-group-1" type="checkbox" name="category[]" value="b">
<input class="category-group-1" type="checkbox" name="category[]" value="c">
</div>
<div>
<input class="category-group-2" type="checkbox" name="category[]" value="x">
<input class="category-group-2" type="checkbox" name="category[]" value="y">
<input class="category-group-2" type="checkbox" name="category[]" value="z">
</div>
I need to require that at least one checkbox from each group be checked in order to pass validation. But as the validation plugin references fields by name rather than class or ID, I can't work out how to do this.
Any help would be appreciated, thanks.
category[1]while the second grouping is namedcategory[2]