title: js disabling backspace functionality in firefox
body: <p>I have following javascript to prevent user from entering invalid characters into a text field. It's working well in chrome but not in firefox. It's preventing the <kbd>backspace</kbd> key to be entered in the text field in firefox.</p>
  
  <pre><code>function onlyNumbers(evt) {
      var theEvent = evt || window.event;
      var key = theEvent.keyCode || theEvent.which;
      key = String.fromCharCode( key );
      var regex = /[0-9]|\./;
      if( !regex.test(key) ) {
          theEvent.returnValue = false;
          if(theEvent.preventDefault) theEvent.preventDefault(); 
      }
  }
  </code></pre>
  
  <p>Can anyone please have a look and propose a fix for firefox to not prevent backspace key to act on a text field ?</p>
  
  <p>Probably I guess, adding the regex for the backspace character would do the job here. Does anyone know, how to add the regex for matching the <kbd>backspace </kbd></p>
  
  <h3>Edit:</h3>
  
  <p>Also, the above code has supposed to interrupted with the <kbd>Tab</kbd> key behaviour, I am not able to jump to next fields in the form using <kbd>Tab</kbd> key. </p>