Determine if JavaScript e.keyCode is a printable (non-control) character
Keydown will give you the keyCode of the key pressed, without any modifications. $(“#keypresser”).keydown(function(e){ var keycode = e.keyCode; var valid = (keycode > 47 && keycode < 58) || // number keys keycode == 32 || keycode == 13 || // spacebar & return key(s) (if you want to allow carriage returns) (keycode > 64 … Read more