Hello friends........ .
In my project i use 2 textfields(name and designation). both the text fields should enter only letters and no numbers should be enterd. i wrote the function for it and i called it in the onBlur function of the textfields. but the problem is that if i enter any number or simply press the tab button it shows the alert message" invalid entry" and it keeps on goin in the loop. i have to press ctrl+alt+del to terminate the pgm.. if i change the on blur to onchange it works fine, but the focus function is not working....
thanks..
In my project i use 2 textfields(name and designation). both the text fields should enter only letters and no numbers should be enterd. i wrote the function for it and i called it in the onBlur function of the textfields. but the problem is that if i enter any number or simply press the tab button it shows the alert message" invalid entry" and it keeps on goin in the loop. i have to press ctrl+alt+del to terminate the pgm.. if i change the on blur to onchange it works fine, but the focus function is not working....
Code:
function isAlphabetic(val)
{
if (val.value.match(/^[ a-zA-Z.]+$/))
{
return true;
}
else
{
alert("hi Invalid Entry");
val.focus();
return false;
}
}
Comment