javascript validation of textbox in asp.net
<p>i have one text box and button in asp.net like</p>

<pre><code>&lt;tr&gt;
&lt;td style="width: 100px"&gt;
 &lt;asp:Label ID="lbltime" runat="server" Text="Enter Time"&gt;&lt;/asp:Label&gt;
&lt;/td&gt;
  &lt;td style="width: 100px"&gt;
  &lt;asp:TextBox ID="Txttime" onkeypress="return isNumberKey(event)" runat="server"&gt;&lt;/asp:TextBox&gt;
&lt;/td&gt;         
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style="width: 100px" align="center"&gt;
  &lt;asp:Button ID="Btntime" runat="server" Text="Button" /&gt;
  &lt;/td&gt;
&lt;/tr&gt;
</code></pre>

<p>now i want to write javacript code  to validate on my textbox which work when i click on button 
now i want to know hopw to call fuction of javascript in button and 
the funtion should do work like is 
button should send the text box value to the fuction and function should check the value to integer number only. nad if not found should give the error message in the dialog box that "please enter value in integer only"</p>

<p>i m trying the javascript like this</p>

<pre><code>function isNumberKey(textboxvalue)
      {
          evt=textboxvalue.text;
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode &gt; 31 &amp;&amp; (charCode &lt; 48 || charCode &gt; 57))
            textboxvalue.text="Enter in Integer Only";
            return false;

         return true;
      }
</code></pre>
