Skip to content

Instantly share code, notes, and snippets.

@tivac
Created April 23, 2010 00:03
Show Gist options
  • Save tivac/376007 to your computer and use it in GitHub Desktop.
Save tivac/376007 to your computer and use it in GitHub Desktop.
YUI.add('validation-plugin', function(Y) {
function ValidationPlugin(config) {
ValidationPlugin.superclass.constructor.apply(this, arguments);
}
Y.mix(ValidationPlugin, {
NAME : "validation",
NS : "form",
ATTRS : {
}
});
Y.extend(ValidationPlugin, Y.Plugin.Base, {
initializer : function(config) {
this.get('host').before('submit', this._validate);
this.doBefore('submit', this._validate2);
},
_validate : function(e) {
e.halt();
console.log("plugin validate .before"); //TODO: REMOVE DEBUGGING CODE
},
_validate2 : function(e) {
e.halt();
console.log("plugin validate .doBefore"); //TODO: REMOVE DEBUGGING CODE
}
});
Y.namespace('Plugin').Validation = ValidationPlugin;
}, '0.1', { requires : ['plugin', 'node', 'selector-css3', 'event'] });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment