Is there a quick way to set an HTML text input () to only allow numeric keystrokes (plus \'.\')?
I opted to use a combination of the two answers mentioned here i.e.
and
function isNumberKey(evt){ var charCode = (evt.which) ? evt.which : evt.keyCode return !(charCode > 31 && (charCode < 48 || charCode > 57)); }