Skip to content

Instantly share code, notes, and snippets.

@dethbiscuit
Created July 5, 2018 05:46
Show Gist options
  • Save dethbiscuit/265c37c60d0d8fc6978763479a49e1b8 to your computer and use it in GitHub Desktop.
Save dethbiscuit/265c37c60d0d8fc6978763479a49e1b8 to your computer and use it in GitHub Desktop.
[jQuery] txtbox numbers only
$(document).ready(function () {
$("#quantity").keypress(function (e) {
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
$("#errmsg").html("Digits Only").show().fadeOut("slow");
return false;
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment