Saturday, August 4, 2012

How to dynamically disable the .numeric() in jquery.alphanumeric.js


Put Following in the jquery.alphanumeric.js. Then use $(element).removeNumeric(); to disable the numeric method
$.fn.removeNumeric = function() { return this.data("numeric.decimal", null).data("numeric.negative", null).data("numeric.callback", null).unbind("keypress", $.fn.numeric.keypress).*unbind("keyup", $.fn.numeric.keyup)*.unbind("blur", $.fn.numeric.blur); }

Bind Some Event to Element and trigger that function when click the element

Scenario: Suppose if we used same click event function in various web pages. if you want do some logic some page button for that need to re...