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 use HTML5 pattern attribute to do this:
If the user enters an input that conflicts with the pattern, it will show an error dialogue automatically.