I have a form where the required field is depend on another form field value. So the required rule may be true or false depend on the other field. The issue is accept rule should be there if only the required is true. How can I do that?
...,
fieldA: {
maxlength: 3,
accept: "[0-9]{3}",
required: function() {
if($('#fieldB').val() == 'ABCD') {
return false;
} else {
return true;
}
}
},...
Thanks in advance.