I want to implement onkeypress event for a textbox in asp.net to call a javascript function that validates textbox for number field. How can i validate a textbox in asp.net for number field using javascript function but that javascript function is not calling. This is my javascript function
function FDigit(x)
{
if (x.KeyCode < 48 || x.KeyCode > 57)
{
alert("Enter Digits only");
return false;
}
this is my textbox control from where i have called for onkeypress event.
<td><asp:TextBox ID="txtSalary" runat="server" OnKeyPress="return FDigit(x)"></asp:TextBox>