validate_inputs.js 397 Bytes
Newer Older
Billy Larru committed
1 2 3 4 5 6 7 8 9 10 11 12 13
(function (a) {
  a.fn.validCampo = function (b) {
    a(this).on({
      keypress: function (a) {
        var c = a.which,
          d = a.keyCode,
          e = String.fromCharCode(c).toLowerCase(),
          f = b;
        (-1 != f.indexOf(e) || 9 == d || 37 != c && 37 == d || 39 == d && 39 != c || 8 == d || 46 == d && 46 != c) && 161 != c || a.preventDefault()
      }
    })
  }
})(jQuery);