validating checkboxes
validating checkboxes
I have a jsp page that contains 2 set of check boxes (these are generated with a for loop, so values are assigned at runtime). I want to make sure that at least one check box is selected from either set. I have this for validation:
[code] $(document).ready( function() {
$("#aForm").validate({
rules : {
'aCheckbox':{
required : {
depends: function(element) {
return $("#bCheckbox:not(':checked')")
}
}
}
},
messages : {
aCheckbox: "select a box."
}
});[/code]
This does not seem to work. Please help.