Last active
December 19, 2015 02:39
-
-
Save mpsenn/5884946 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* IE 7-9 don't trigger the onchange event when the user uses autocomplete. | |
* Extend the jQuery change event to fill in that trigger. | |
*/ | |
(function($) { | |
// Keep the old change function around for later | |
var oldchange = $.fn.change; | |
$.fn.change = function(handler) { | |
// Register with jQuery to call the function like normal | |
var result = oldchange.apply(this, handler); | |
if(handler) { | |
// Just for text boxes, call this special function on blur | |
this.filter('input[type="text"]').blur(function(event) { | |
$(this).change(event); | |
}); | |
} | |
return result; | |
} | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment