Skip to content

Instantly share code, notes, and snippets.

@copleykj
Created July 24, 2013 21:23
Show Gist options
  • Save copleykj/6074687 to your computer and use it in GitHub Desktop.
Save copleykj/6074687 to your computer and use it in GitHub Desktop.
A Mesosphere rule to make sure a check box array has at least one field checked.
Mesosphere.registerRule("exactChecked", function(fieldValue, ruleValue, fieldName, formFieldsObject, fieldRequirements){
if(_(formFieldsObject[fieldName]).isArray() && formFieldsObject[fieldName].length == ruleValue){
return true;
}
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment