-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refreshing the Credit Card Image #471
Comments
I have the same problem |
I use JQuery and this works for me to show the card with the values that are prefilled updated. $(document).ready(function() {
const blur = new Event('blur');
const change = new Event('change');
$('form').find(':input').each(function() {
if (this.name === "number" || this.name === "name" || this.name === "expiry" || this.name === "cvc") {
this.dispatchEvent(blur);
this.dispatchEvent(change);
}
})
}); This assumes your field names are like mine above. Works like a charm |
Same here. Angular code: But, when set the input to empty, this doesn't work, tried these events: change, keydown, keyup, blur, keypress. |
@ronaldohoch and you are using the latest version found in the /dist folder here? Just making sure its not already fixed as we have committed some fixes since the 2.5.0 release that is on NPM. |
Also I think I had to fire BOTH |
Due Content Security Policy, i need to download the file '-' |
No this 2.5.1 is not published to NPM yet: https://github.com/jessepollak/card/tree/master/dist |
You can see what has been fixed in 2.5.1 here: https://github.com/jessepollak/card/milestone/2?closed=1 |
Worked! Thank you :) |
I have the masked Credit Card No (**** **** **** 1234), expiry and Name stored on a cell phone. When the user wants to update their credit card information it would be nice if the form showed the currently saved values without having the user enter data in each field. So is there a way to cause the form to refresh using the values in the pre-loaded fields?
The text was updated successfully, but these errors were encountered: