Skip to content
thedersen edited this page Dec 26, 2011 · 1 revision
var SomeModel = Backbone.Model.extend({
  validation: {
    age: {
	  max: 100
	}
  }
});
  • number higher than max is invalid
  • non numeric value is invalid
  • number equal to max is valid
  • number lower than max is valid
  • numeric string values are treated as numbers
  • when required is not specified undefined is invalid
  • when required is not specified null is invalid
  • when required:true undefined is invalid
  • when required:true null is invalid
  • when required:false null is valid
  • when required:false undefined is valid
Clone this wiki locally