Hi,
function AllowAlphabet(e)
{
isIE=document.all? 1:0
keyEntry = !isIE? e.which:event.keyCode;
if(((keyEntry >= '65') && (keyEntry <= '90')) || ((keyEntry >= '97') && (keyEntry <= '122')) || (keyEntry=='46') || (keyEntry=='32') || keyEntry=='45' )
return true;
else
return false;
}
Usage :
<input type="text" onkeypress="return AllowAlphabet(event)">
function AllowAlphabet(e)
{
isIE=document.all? 1:0
keyEntry = !isIE? e.which:event.keyCode;
if(((keyEntry >= '65') && (keyEntry <= '90')) || ((keyEntry >= '97') && (keyEntry <= '122')) || (keyEntry=='46') || (keyEntry=='32') || keyEntry=='45' )
return true;
else
return false;
}
Usage :
<input type="text" onkeypress="return AllowAlphabet(event)">
No comments:
Post a Comment