Skip to content

Instantly share code, notes, and snippets.

@joelpurra
Last active October 2, 2015 13:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelpurra/2254354 to your computer and use it in GitHub Desktop.
Save joelpurra/2254354 to your computer and use it in GitHub Desktop.
AutoCleanCallback: Automatic HTML input field cleaning onkeyup/onchange using jQuery
@pbearne
Copy link

pbearne commented Mar 30, 2012

doesn't handle more than one input at a time

and needs the debug lib to work or just add debug = console if you know that console will there

@joelpurra
Copy link
Author

True that it doesn't work with multiple jQuery (sub)objects, but the .length check is just there because it has not been properly tested. QUnit tests are most welcomed (I will create a new github project if so), and also a bit of syntactic sugar/refactoring to allow $("whatever").autoClean...().

It is better to use the debug library than debug = console in a public (internet) environment, but go ahead if you're using it with a known set of browsers.

@joelpurra
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment