Skip to content

Instantly share code, notes, and snippets.

@lsmith
Created November 17, 2009 18:08
Show Gist options
  • Select an option

  • Save lsmith/237110 to your computer and use it in GitHub Desktop.

Select an option

Save lsmith/237110 to your computer and use it in GitHub Desktop.
myAutoComplete._isIgnoreKey = (function (original) {
return function (keyCode) {
return (keyCode > 47 && keyCode < 58) || original.apply(this, arguments);
}
})(myAutoComplete._isIgnoreKey);
// OR
myAutoComplete._sendQuery = (function (original) {
return function (text) {
if (/\D/.test(text)) {
original.apply(this, arguments);
}
}
})(myAutoComplete._sendQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment