Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCard number formatting for card numbers with length >16 is broken #246
Comments
|
Allowed lengths for visa: 13, 16, 19 |
|
@Yottster OK. I was unaware that there are 19 digit visa card numbers. Personally I have never come across one but either way if card.js supports the input of 19 digits it should handle 19 digits in the preview without wrapping them. |
|
Ugh yeah, this needs to be fixed. Renaming to be more clear. Would love to accept a PR for this change. If anyone is interested in contributing this in, I think the best solution would likely resize the text size of the card number field once its goes past 16 numbers. A library like textFit could be used. |
|
Is there a way to limit Visa to be 16 characters ? System like Cyber source doesnt allow Visa card to be 19 digits |
|
@tonywong625 It's been a while, but if you need to, it's pretty easy. card.js: https://github.com/jessepollak/card/blob/master/dist/card.js#L1087 jquery.card.js: https://github.com/jessepollak/card/blob/master/dist/jquery.card.js#L1133 Just remove the ", 19" part. All of the card validation is done in those areas, so you can make any other changes you want, although I've only found the 19 digit visa to be an issue. |
|
I dont want to edit the core js, would be better if there is an option to overwrite it imo. |


Not sure if this is intentional or not. However when I enter a visa card number i can enter 3 digits more (total of 19) than should be allowed ? (16). Is there a reason for this?
This doesn't happen on mastercard numbers or amex etc.
Screenshot from your demo site:
