title: Disable spaces in Input, AND allow back arrow?
body: <p>I am trying to disable spaces in the Username text field, however my code disables using the back arrow too. Any way to allow the back arrow also?</p>
  
  <pre><code>    $(function() {
           var txt = $("input#UserName");
           var func = function() {
                        txt.val(txt.val().replace(/\s/g, ''));
                     }
           txt.keyup(func).blur(func);
      });
  </code></pre>
  
  <p>fiddle:  <a href="http://jsfiddle.net/EJFbt/" rel="noreferrer">http://jsfiddle.net/EJFbt/</a></p>