will there be onkeypress event for textbox in asp.net for calling javascript function
<p>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</p>

<pre><code>function FDigit(x)
{
if (x.KeyCode &lt; 48 || x.KeyCode &gt; 57)
{
    alert("Enter Digits only");
    return false;
}
</code></pre>

<p>this is my textbox control from where i have called for onkeypress event.</p>

<pre><code>&lt;td&gt;&lt;asp:TextBox ID="txtSalary" runat="server" OnKeyPress="return FDigit(x)"&gt;&lt;/asp:TextBox&gt;
</code></pre>