validateInclusionOf

  • function
can.Map.validations.static.validateInclusionOf  

observe.validateInclusionOf(attrNames, inArray, options)

Validates whether the values of the specified attributes are available in a particular array.

init : function(){
  this.validateInclusionOf(["salutation"],["Mr.","Mrs.","Dr."])
}

Parameters

  1. attrNames {Array<String>}

    Attribute name(s) to to validate

  2. inArray {Array}

    Array of options to test for inclusion

  3. options {Object}Optional

    Options for the validations. Valid options include 'message' and 'testIf'.