title: Remove special characters but allow spaces
body: <p>I have the following which removes special characters from being entered into a input</p>
  
  <pre><code>$('input').on('keypress', function (event) {
      var regex = new RegExp("^[a-zA-Z0-9]+$");
      var key = String.fromCharCode(!event.charCode ? event.which : event.charCode);
      if (!regex.test(key)) {
          event.preventDefault();
          return false;
      }
  });
  </code></pre>
  
  <p>Is there any way I can add spaces to this, and limit it to only 8 characters being entered?</p>
  
  <p>Thanks</p>