I keep getting the error 'validate is not a function'
function someObj( nameOfObj ) {
this.nameOfObj = nameOfObj;
var create = '<input id=' + nameOfObj + '>';
document.write(create);
someObject.prototype.validate = function( ) {
//nonsense
}
jQuery( '#' + this.nameOfObj ).bind( 'input', function( ) {
this.validate( ); //or validate( ); <------- Not working here
} );
}
I want to create an object that is a self validating <input>
as the user types, it will execute valitdate( )
and I want to bind this validation during instantiation.