Created
October 25, 2020 10:32
-
-
Save akionsight/c3205a177ec34aaacdcdd21325075271 to your computer and use it in GitHub Desktop.
A simple script to block space in input boxes (Uses jQuery)
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
$(document).ready(function() { | |
$('#test-input').on('keypress', function (e) { | |
if (e.which == 32) { | |
console.log('space detected, aborting space'); | |
return false | |
} | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment