validateLengthOf

  • function
can.Map.validations.static.validateLengthOf  

observe.validateLengthOf(attrNames, min, max, options)

Validates that the specified attributes' lengths are in the given range.

init : function(){
    this.validateLengthOf(["suffix"],3,5)
}

Parameters

  1. attrNames {Array<String>}

    Attribute name(s) to to validate

  2. min {Number}

    Minimum length (inclusive)

  3. max {Number}

    Maximum length (inclusive)

  4. options {Object}Optional

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