Numeric Validation Method function onlyNumbers(evt) { var e = event || evt; // for trans-browser compatibility var charCode = e.which || e.keyCode; if (charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; } Character Validation Method function onlyAlpha() { var keyCode = window.event.keyCode; if ((keyCode < 65 || keyCode > 90) && (keyCode < 97 || keyCode > 123) && keyCode != 32) return false; return true; } *****Output****** Allow Only Numbers Accept only Number : Accept only Character :