Flags have the same name but different meanings. This way you can find the selected ones and then check the values ββfor a specific one. I did something similar with the switches. Here, one of my rules specifying the daypattern field is required if the radio object recurpattern is set to day.
daypattern: {
required:
function(element){
return ($("input[name='recurpattern']:checked").val() == 'day')
}
}
In your case, your checkbox set has an array in your checkbox.val () file. Therefore, you verify that your test value is in this array.
source
share