How can I trigger validation onblur with CanJS?

121 Views Asked by At

I have a Can JS model with an init that runs this.validateNonBlank("title");. How can I trigger that validation to run onblur, when I tab out of the title field? Right now it only triggers when another element triggers the change event.

can.Model.Cacheable("CMS.Models.Program", {
  root_object : "program"
  , root_collection : "programs"
  ...
  , links_to : {
    "Regulation" : "ProgramDirective"
    , "Policy" : "ProgramDirective"
    ...
    , "Market" : {}
  }
  , init : function() {
    var that = this;
    this.validateNonBlank("title");
    this._super.apply(this, arguments);
  }
}, {
});

(The full code is here.)

0

There are 0 best solutions below