#Abishek-card-country
1 messages · Page 1 of 1 (latest)
Selected when?
After you create the PaymentMethod, the object you get back should have this in its card.country property https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-country
so I have another field in my form called State/Province. When a customer selects the country, I want to load the states on the Form.
so, I am trying to see if there is listener I can listen to when the country is changed and I can load the state field
also, I am using setup intents for future use
let me know if it makes sense
Gotcha. That does make sense
You can listen to the onChange method of the element https://stripe.com/docs/js/element/events/on_change?type=paymentElement
Are you already doing that? I forget exactly what it returns at the moment but I believe you can see card brand and country
I was going to, but I wasn't sure if that triggers when the country is changed
Oh is this with the Payment Element?
Let me test this a bit. If it isn't in that event unfortunately I don't think there is another way to do that at the moment.
i tried to see if there was a country element, but it did not seem to be
if this is not possible, is there a way to hide the country dropdown?
Good question. Will look in to that as well.
thank you
You can write to support with a feature request to include this as a value in the onChange event: https://support.stripe.com/?contact=true
So, I can actually display all those fields on the form instead of creating my own? I thought it wasn't possible to show the other fields
No, unfortunately that is just hiding the field within the Payment Element
Let me see how to include info from your own fields
I assume you want to hide the field in the Payment Element and then have your own country field or do you have a different idea?