function AllowAlphabet(e) {
isIE = document.all ? 1 : 0
keyEntry = !isIE ? e.which :
event.keyCode;
if (((keyEntry >= '65') && (keyEntry <= '90')) || ((keyEntry >= '97') && (keyEntry <= '122')) || (keyEntry == '08') || (keyEntry == '46') || (keyEntry == '32') || keyEntry == '45')
return true;
else {
alert('Please Enter Only Alphabet Characters, Not Numbers and
Special Charactors .');
return false;
}
}
<asp:textbox id="txt_Name" runat="server" onkeypress="return
AllowAlphabet(event)" ></asp:textbox>
No comments:
Post a Comment