omarshammas / jquery.formance

A jQuery library for formatting and validating form fields, based on Stripe's jQuery.payment library.
omarshammas.github.io/formancejs
Other
632 stars 105 forks source link

Uncaught TypeError: $.formance.formatCardNumber is not a function (with fix) #24

Open mkaatman opened 9 years ago

mkaatman commented 9 years ago

Uncaught TypeError: $.formance.formatCardNumber is not a function

value = $.formance.formatCardNumber(value); doesn't exist the corrected line is: value = $.formance.formatCreditCardNumber(value);

  reFormatCardNumber = function(e) {
    var _this = this;

    return setTimeout(function() {
      var $target, value;

      $target = $(e.currentTarget);
      value = $target.val();
      console.log($.formance);
      value = $.formance.formatCreditCardNumber(value);
      return $target.val(value);
    });
  };