How to allow only numbers(digits) to input
This is javascript function that doesn’t permits to input characters others than number:
function inputOnlyNumbers(evt){
var e = window.event || evt; // for trans-browser compatibility
var charCode = e.which || e.keyCode;
if ((charCode > 47 && charCode < 58) || charCode == 8){
return true;
}
return false;
}
And this is how to call it example html snippet:
...
...
No related posts.























