Created
October 25, 2017 07:23
-
-
Save jamalnasir/5f1f4c3b16c610a95d2ef50c1802c95b to your computer and use it in GitHub Desktop.
This script allow only numeric values in the text fields
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
$('body').on('keydown', 'input[name=random]', function(e) { | |
return ((e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 96 && e.keyCode <= 105) || e.keyCode == 173 || e.keyCode == 8 || e.keyCode == 9) ? true : false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment