title: How to specify which characters are allowed in a textbox with jQuery?
body: <p><a href="http://jsfiddle.net/WhP8q/" rel="nofollow">http://jsfiddle.net/WhP8q/</a></p>
  
  <p>I'm trying to restrict input to alpha numeric, 0-9, A-Z,a-z.</p>
  
  <p>The ASCII table i'm referencing: <a href="http://www.asciitable.com/" rel="nofollow">http://www.asciitable.com/</a>
  Here is what I have so far</p>
  
  <pre><code>$(function() {
      $("input").bind("keydown paste", function(e) {
          var code = (e.keyCode ? e.keyCode : e.which);
          var c = code;
          var letterAllowed = ((c &gt; 47 &amp;&amp; c &lt; 58) || (c &gt; 64 &amp;&amp; c &lt; 90) || (c &gt; 96 &amp;&amp; c &lt; 123))
          if (code &gt; 32 &amp;&amp; !letterAllowed) {
              return false;
          }
      });
  });​
  </code></pre>
  
  <p>right now, the tilde (~) character is prevented from getting input into the field, but other special / shift characters such as !@#$% all get entered into the text field.
  I'm pretty sure my logic is sound, but my issue is with some misunderstanding of javascript bindings? idk</p>