Skip to content
martin308 edited this page Jun 14, 2012 · 2 revisions
var SomeModel = Backbone.Model.extend({
  validation: {
    age: {
	  min: 1
	}
  }
});
  • non numeric value is invalid
  • number lower than min is invalid
  • number equal to min is valid
  • number greater than min is valid
  • numeric string values are treated as numbers
  • NaN is valid
  • when required is not specified null is invalid
  • when required is not specified undefined is invalid
  • when required:false null is valid
  • when required:false undefined is valid
  • when required:true null is invalid
  • when required:true undefined is invalid
Clone this wiki locally