Skip to content
This repository has been archived by the owner on Jan 10, 2018. It is now read-only.

formatting doesn't add spaces or / on Android #46

Closed
jc00ke opened this issue Apr 19, 2013 · 7 comments
Closed

formatting doesn't add spaces or / on Android #46

jc00ke opened this issue Apr 19, 2013 · 7 comments

Comments

@jc00ke
Copy link

jc00ke commented Apr 19, 2013

2013-04-19 10 27 21

Chrome v 26.0.1410.58
I have a report that it doesn't work on the stock Android browser either.

@noelrocha
Copy link

It looks like doesn't accept the spaces. Anyone with a good solution?

@firecall
Copy link

Workaround: Use a jQuery masking plugin, or if using bootstrap, the JASNY extensions have a masking plugin.

@edlebert
Copy link

edlebert commented Aug 9, 2013

This is a huge issue. Not only does the formatting not work, for some reason it adds a space to the beginning of the CVC field when you focus on it for the first time.

@edlebert
Copy link

This is related to a chromium bug where the keycode is always zero for keyup/keydown events. But that bug has been open for over a year, soooo... I don't know if/when chromium will ever fix it.

@edlebert
Copy link

This appears to be the related chromium issue: https://code.google.com/p/chromium/issues/detail?id=118639

@SeanLS
Copy link

SeanLS commented Oct 24, 2013

The following lines need to be updated (add input as event type for android support Lines 367 to 390):

$.payment.fn.formatCardCVC = function() {
this.payment('restrictNumeric');
this.on('keypress input', restrictCVC);
return this;
};

$.payment.fn.formatCardExpiry = function() {
this.payment('restrictNumeric');
this.on('keypress input', restrictExpiry);
this.on('keypress input', formatExpiry);
this.on('keypress input', formatForwardSlash);
this.on('keypress input', formatForwardExpiry);
this.on('keydown input', formatBackExpiry);
return this;
};

$.payment.fn.formatCardNumber = function() {
this.payment('restrictNumeric');
this.on('keypress input', restrictCardNumber);
this.on('keypress input', formatCardNumber);
this.on('keydown input', formatBackCardNumber);
this.on('keyup input', setCardType);
this.on('paste input', reFormatCardNumber);
return this;
};

$.payment.fn.restrictNumeric = function() {
this.on('keypress input', restrictNumeric);
return this;
};

@jamesreggio
Copy link
Contributor

Fixed in #102 and available in v1.1.0.

https://github.com/stripe/jquery.payment/releases/tag/v1.1.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants