I want to allow only alphabets in textbox using JavaScript I used the code:
var nam=f.nm.value; if(!isNaN(nam)) region.innerHTML=\"alphabets only\"; <
You can try:
function onlyAlphabets(e, t) { return (e.charCode > 64 && e.charCode < 91) || (e.charCode > 96 && e.charCode < 123) || e.charCode == 32; }