A textbox exists with text "test" in it. The user begins to type in that textbox and presses escape key to undo editing such that the value "text" is restored again.
In keydown bind function, I call reset on textbox but that sets the textbox empty:
$.fn.textbox.defaults = $.extend({},$.fn.textbox.defaults,{
inputEvents:$.extend({},$.fn.textbox.defaults.inputEvents,{
keydown:function(e){
if(e.keyCode == 27){
var target = e.data.target;
$(target).textbox('reset');
}
}
})
});
How can I reset the value that was there prior to edit?