Here is my code:
dojo.provide("test.validation");
dojo.declare("test.validation", null, {
addValidate : function(a) {
this.a = dijit.byId(a);
var link = dojo.connect(dijit.byId("form"), "onclick", this.validate);
},
validate : function(e) {
e.preventDefault();
console.log(this);
if (!this.a.isValid()) {
return false;
}
}
});
I would like call this: this.a.isValid() function, but I'm out of my object scope.
How can I bind it to that onclick event?