I have rules that validate a group (requires one of 3). That works fine, however, I need to only have the 1 of 3 requirement depend on a selection in the form.
rules: {
cloudfront_7: {
require_from_group: {
depends: function(element) {
if ($( "#classify" ).val() == "PIC" ){
return false;
} else {
return [1, ".verification-group"];
}
}
}
},
cloudfront_8: {
require_from_group: {
depends: function(element) {
if ($( "#classify" ).val() == "PIC" ){
return false;
} else {
return [1, ".verification-group"];
}
}
}
},
cloudfront_9: {
require_from_group: {
depends: function(element) {
if ($( "#classify" ).val() == "PIC" ){
return false;
} else {
return [1, ".verification-group"];
}
}
}
}
}
I noticed that it just returns true
instead of the code I wrote, which is necessary for the require_from_group()
function.