error not unsetting in validate plugin in dependent field

error not unsetting in validate plugin in dependent field

I've got a group of 3 radio buttons, 'foo[]'; if the user selects #foo0, then #fooDetail is not required, but if the user selects either #foo2 or #foo3, #fooDetail is required:


  1. var $req = "required";
  2. foo: $req,
  3. fooDetail: {
  4.       required: function(element) {
  5.             return $("#foo1").is(":checked")||$("#foo2").is(":checked");
  6.             }
  7. },
The problem is, if someone selects #foo1 or #foo2, changing the selection to #foo0 doesn't unset the error message on #fooDetail. I've also tried
  1.       return $("#foo0").not(":checked");
which fails similarly. How to fix?

Thanks,