validateRangeOf

  • function
can.Map.validations.static.validateRangeOf  

observe.validateRangeOf(attrNames, low, hi, options)

Validates that the specified attributes are in the given numeric range.

init : function(){
  this.validateRangeOf(["age"],21, 130);
}

Parameters

  1. attrNames {Array<String>}

    Attribute name(s) to to validate

  2. low {Number}

    Minimum value (inclusive)

  3. hi {Number}

    Maximum value (inclusive)

  4. options {Object}Optional

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