Created
March 22, 2018 20:23
-
-
Save muthugit/460acd0c98124e8caff06e6eeacf9640 to your computer and use it in GitHub Desktop.
How to stop special characters from input box runtime?
This file contains 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
$('#inputBoxId').keypress(function(e) { | |
if (!/[a-zA-Z-]/.test(String.fromCharCode(e.which))) | |
return false; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment