A jQuery plugin to clean input fields with common functionality, like trim, normalize whitespace, digits only. It is also easily extensible.
Last active
October 2, 2015 13:58
-
-
Save joelpurra/2254354 to your computer and use it in GitHub Desktop.
AutoCleanCallback: Automatic HTML input field cleaning onkeyup/onchange using jQuery
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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