Is there a way to easily override jQuery\'s val() function?
The reason I want to override it is that I want to add some processing each time a value is
I know the problem is old but just to give a full solution. In order for both the jQuery.val() and the jQuery.val(value) to work after override you need to override it properly and separately. Because when calling jQuery.val() then originalVal.call(this, value); will not work correctly.
To do it in a correct way you need to do something like that when getting the value: originalVal.call(this);
Here is a site where everything is explained: http://extremedev.blogspot.com/2012/01/override-jqueryval-and-jqueryvalvalue.html
Regards, Roman