I am using jQuery Validation plugin to validate check box since it does not have default option, One should be selected and max two check boxes can be selected, these is the criteria. I am not getting any error and it is not validating. I am extending it like below,
<input type="checkbox" name="test[]" />x
<input type="checkbox" name="test[]" />y
<input type="checkbox" name="test[]" />z
$("#formid").validate({
rules: {
test[]: {
required: function(elem)
{
return $("input.select:checked").length > 0;
}
},
messages: {
test[]: "You must check at least 1 box"
}
});