title: Allow Numbers and Special Characters only not alphabets
body: <p>i have a textbox, in that i want to restrict the alphabets only, that is it will accept only numbers and special charcaters not alphabets..</p>
  
  <p>i had tried the below java script ,but it will not working ....</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      //Function to allow only numbers to textbox
      function validate(key) {
          //getting key code of pressed key
          var keycode = (key.which) ? key.which : key.keyCode;        
          //comparing pressed keycodes
  
          if (keyCode &gt;= 65 &amp;&amp; keyCode &lt;= 90) {
              return false;
          }       
      } 
      &lt;/script&gt;
  </code></pre>
  
  <p>and in the textbox </p>
  
  <pre><code> &lt;asp:TextBox ID="txt1" runat="server" OnTextChanged="txtoldpwd_TextChanged"
                              onkeypress="return validate(event)"&gt;&lt;/asp:TextBox&gt;
  </code></pre>