Created
November 21, 2018 04:38
-
-
Save omernaci/1e9fd8c93ba5075f8e644e0dea2a6da9 to your computer and use it in GitHub Desktop.
Jquery Number Validation only Allow Ctrl + V,C,S,X
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
| $('#theField').on('keypress input', function() { | |
| var value = $(this).val(); | |
| value = value.replace(/\D+/, ''); // removes any non-number char | |
| $(this).val(value); | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment