As shown below, I am passing a variable from the inputclass callback to the validate callback.
Could it be done so without using a global variable so it will be local to the instance when applying the jQuery plugin to the given element?
$('#name').editable({
inputclass: function() {
globalVariable=this;
},
validate: function (value) {
console.log(globalVariable);
return 'pause';
}
});
thiswithininputclassrefers to a createdinputelement while withinvalidaterefers to the originally element which the plugin was applied to.