Created
August 1, 2016 19:30
-
-
Save davelowensohn/141b0d3f9a0e465850f2a2c4ee8adfc9 to your computer and use it in GitHub Desktop.
Prevent negative number entry on specified number inputs
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
Ember.$('.positive').keypress(function(e) { | |
if(!((e.keyCode > 95 && e.keyCode < 106) || (e.keyCode > 47 && e.keyCode < 58) || e.keyCode === 8)) { | |
return false; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment