Skip to content
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

Rendering card with dynamically value doesn't work #306

Closed
jimblue opened this issue Dec 21, 2016 · 8 comments
Closed

Rendering card with dynamically value doesn't work #306

jimblue opened this issue Dec 21, 2016 · 8 comments
Labels

Comments

@jimblue
Copy link

jimblue commented Dec 21, 2016

Hello

I have two inputs for my client name in a form:

  • firstname
  • lastname

I made a little script to automatically update the name on card with this two inputs.

A trigger('input') is fired on each changing value to be sure the name on card input is updated but still the corresponding text on card.js is not rendered.

It's seems that only a TAB press that focus on name on card input render the card.js. Even a click on this input didn't seems to work.

I've created a fiddle so you can see the problem:

Hope someone can help :)

Cheers

this issue looks a bit like #184

@chandler767
Copy link

chandler767 commented Dec 21, 2016

You can use two inputs for the name on card by setting nameInput to your two fields. In your case, try this:
nameInput: 'input[name="firstname"], input[name="lastname"]',

https://jsfiddle.net/b8fjvpno/

@jimblue
Copy link
Author

jimblue commented Dec 21, 2016

Hey @chandler767,

Thanks for your fast answer!

But with your option I can't write a specific name for the card. It can happen sometimes to pay with a card that have a different name from delivery address...

Any other idea?

@murilo3m
Copy link

I'm facing a similar problem. I'm using it on my checkout and when I choose the installment I need to do a quick refresh on the payment method div, but when I do so the CSS of the brand is lost and can't force the event to get the data again. I've tried focusing the field and simulate a key press event, but it didn't work.

If someone has a better idea or solution, please let me know.

@BallisticPain
Copy link
Collaborator

So I need the ability to have a different name with the card and the address on my form. I made an event that updated the card boxes as I typed into the first name box. However as has been pointed out, it didn't update on the card itself until I tabbed into the control.

@BallisticPain
Copy link
Collaborator

Anyone able to submit a PR to expose an event and fix the updating?

@kevalone
Copy link

bump !

@hvaughan3
Copy link

See my answer and the entire thread here.

@CliqLabs
Copy link

CliqLabs commented Nov 3, 2019

Bump

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

No branches or pull requests

8 participants