title: Allow only alphanumeric and - (dash) symbol in textbox
body: <p>I would like to only allow alphabet, special character only a dash (-) and integers in a textbox. And the number i would like to limit them to from 1 to 100. Example A-100</p>
  
  <p>This code allows only numbers to be inserted in the textbox. I want it to allow so that it is something like A-100. Any idea or can someone help to modify this bit of code?</p>
  
  <pre><code>&lt;SCRIPT language="Javascript"&gt;
  function level(evt) {
      var charCode = (evt.which) ? evt.which : event.keyCode
      if (charCode &gt; 31 &amp;&amp; (charCode &lt; 48 || charCode &gt; 57))
          return false;
  
      return true;
  }
  &lt;/SCRIPT&gt;
  </code></pre>
  
  <p>And I call the event as below to the texbox. Only thing is no special character and alphabets it only allows integers.</p>
  
  <pre><code>&lt;asp:TextBox ID="TextBox1" Width="200px" onkeypress="return level(event)" placeholder="Insert level number" runat="server"&gt;&lt;/asp:TextBox&gt;
  </code></pre>