I have rules that validate a group (one of 3 is required). This works fine, however I only need 1 out of 3 requirements to depend on the choice 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 simply returns, trueinstead of the code I wrote, what is needed for the function require_from_group().
source
share