I\'m using the following Javascript to restrict a text field on my website to only accept numerical input, and no other letters or characters. The problem is, it REALLY reje
this will enable the numpad inputs also.
.keydown(function(event){ if(event.keyCode == 8 || event.keyCode == 46) return true; if(event.keyCode >= 96 && event.keyCode <= 105) return true; if(isNaN(parseInt(String.fromCharCode(event.keyCode),10))) return false; });