I have implemented text boxes that only allow numeric values with the help of JavaScript. However, I am facing an issue where I cannot enter a dot symbol or use tab movement. How can I modify this code to include these functionalities?
function CheckNumeric(e) {
if (window.event) { // For IE
if ((e.keyCode < 48 || e.keyCode > 57) && e.keyCode != 8 && e.keyCode != 46 && e.keyCode != 9) {
event.returnValue = false;
return false;
}
} else { // For FireFox
if ((e.which < 48 || e.which > 57) && e.which != 8 && e.which != 46 && e.which != 9) {
e.preventDefault();
return false;
}
}
}