-
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
Update card image after receiving data dynamically #355
Comments
I have the same problemi. |
mine don't work |
you can download the full code: |
Hello people! Filippo, thank you for helping. The problem with your solution is that you change the plugin, so with each update of the plugin we will have to worry about it. As we are in some programmers in the team, this can generate problem later. I think this is a problem for more people, is the plugin not of the same support for updating the image by receiving data dynamically ... But anyway, thanks for the help. |
i try to integrate it to thymeleaf but won't work, in simple html work. |
I resolved the issue with the RudyardKipling solution. |
There is two bugs, I have fixed this. |
Are any of you intending to create a PR so we can get this type of support? I would need to double check with @jessepollak before merging to be sure it fits his direction, but I would be happy to get his attention when we are ready. |
Now works fine! Thanks |
What about when changing the value of the name via Javascript. For instance
The solution above only appears to work when you manually add the value in the HTML. Any suggestions? |
You have to set the first and second names in an input: $ ("#card_name"). Val (first_name + '' + lastName); Var evt = document.createEvent ('HTMLEvents'); Here it worked very well, I just did not update the image of the card after inserting the card number dynamically. |
AguinaldoAranda, |
FWIW, I did this in a very hacky fashion. To wit: $('div.card-wrapper > div > div > div.jp-card-front > div.jp-card-lower > div.jp-card-number.jp-card-display.jp-card-valid').text(cardMasked); Key was setting '.text'. |
After you call and congfigure jquery card,
add the following:
|
@AguinaldoAranda's idea sorta worked. I ended up with the following (event.initEvent() is deprecated):
I just did this for each field I wanted to update dynamically. |
So the credit card style appears do the same as @hvaughan3 but with the focus and blur events and then the card type will appear var focusEvent = new Event('focus');
var blurEvent = new Event('blur');
document.getElementById('cc-number').dispatchEvent(focusEvent);
document.getElementById('cc-number').dispatchEvent(blurEvent); |
@angelcalvasp weird i tried focus blue and it didnt seem to work but did |
Thank you @angelcalvasp and @hvaughan3 as a combination of what you both provided worked for me!
|
Hello guys.
First, congratulations on the plugin, extraordinary!
I use it in an application, where most of the time, the user informs the data of the card directly on the screen. But, for example, when the user uses the visa checkout, which returns the data from the card, then the user does not need to fill in, upon receiving the data the visa checkout already fill in the fields, but, the card image is not fully updated, I used the technique below to update the expiration date, name and CVN:
But the card number does not update , as does the card flag (image)
Does anyone know how to proceed to update the card image and card number?
Thank you very much.
NOTE: Sorry for the translator's English.
The text was updated successfully, but these errors were encountered: