The code below shows how to add the 'onBeforeSetValue' event to the numberbox.
(function($){
var setValue = $.fn.numberbox.methods.setValue;
$.extend($.fn.numberbox.methods, {
setValue: function(jq, value){
return jq.each(function(){
var opts = $(this).numberbox('options');
if (opts.onBeforeSetValue){
var oldValue = $(this).numberbox('getValue');
if (opts.onBeforeSetValue.call(this, value) == false){
setValue($(this), oldValue);
return;
}
}
setValue($(this), value);
})
}
})
})(jQuery);
$(function(){
$('#n1').numberbox({
onBeforeSetValue: function(value){
console.log('onBeforeSetValue:'+value);
return value>10;
},
onChange: function(value){
console.log('onChange:'+value)
}
})
})