title: Force numeric only js function doesn't work in Firefox but in Chrome & IE works fine
body: <p>I have a javascript function which deny any character except numeric one:</p>
  
  <pre><code>$(".number").keypress(this.EnsureNumbers);
  
  EnsureNumbers: function (event) {
     var value = $(this).first().val();
  
     value = value.substring(0, $(this)[0].selectionStart) + String.fromCharCode(event.keyCode) + value.substring($(this)[0].selectionEnd);
     if (!value.match(/^\d+$/)) {
        event.preventDefault();
     }
  }
  </code></pre>
  
  <p>This function allows user (if uses Chrome/IE) to select any part of number (by using SHIFT key) and change selected number/letter.</p>
  
  <p>But in Firefox, this method doesn't allow me to press Backspace or using left/right keys.</p>
  
  <p>Again, in Chrome and IE (even IE8) works fine. Does anyone know is a bug in Direfox ? Or it is from me ?</p>
  
  <p>I have Firefox 22.</p>
  
  <p>Example, take a look over: <a href="http://jsfiddle.net/TR8t4/" rel="nofollow">http://jsfiddle.net/TR8t4/</a></p>