/*
  Character mask for jQuery.
  https://github.com/sobrinho/jquery.singlemask

  Copyright (c) 2011-2013 Gabriel Sobrinho (http://gabrielsobrinho.com/).
  Released under the MIT license
*/
(function ($) {
  function getPasteEvent() {
    var el = document.createElement('input'),

    name = 'onpaste';
    el.setAttribute(name, '');
    return (typeof el[name] === 'function') ? 'paste' : 'input';
  }

  var pasteEventName = getPasteEvent();

  $.fn.singlemask = function (mask) {
    $(this).keydown(function (event) {
      var key = event.keyCode;

      if (key < 16 || (key > 16 && key < 32) || (key > 32 && key < 41)) {
        return;
      }

      return String.fromCharCode(key).match(mask);
    }).bind(pasteEventName, function () {
      this.value = $.grep(this.value, function (character) {
        return character.match(mask);
      }).join('');
    });
  }
})(jQuery);

@@ -648,16 +648,270 @@
      %7D%0A%0A
+      // Numpad key numbers starts on 96 (0) and ends on 105 (9)%0A      // Somehow the String.fromCharCode doesn't knows that%0A      // Subtracting 48 we have the 'standard' number code%0A      if (key %3E= 96 && key %3C= 105) %7B%0A        key = key - 48;%0A      %7D%0A%0A
       re

Fix problem when using the numpad