#nadiya-elements-fields

1 messages · Page 1 of 1 (latest)

blissful halo
#

i'm sorry, i'm quite new to this, if you know any demo github repo using the above? that would be super helpful

worthy jetty
#

I don't have a specific repo or demo no, but it is simply passing the right parameters in JS. So it'd look like this const paymentElement = elements.create( 'payment', { fields: { billingDetails: { address: { country: 'never', postalCode: 'never', } }, }, } );

blissful halo
#

i've to follow the same procedure from this doc, but instead of creating card element, i've to create a payment element?

worthy jetty
#

I don't know which doc you are using here

#

you explicitly asked about the country field which is for PaymentElement. The card element doesn't have that

blissful halo
#

yeah, sorry ! i was confused about the different doc and i figured it out later
Now, another question
i've created the payment page with the the above doc that you provided, and i think i almost followed the same doc, but the elements are showing inline

worthy jetty
#

yeah you're not using the docs I mentioned at all if you get that UI

#

What do you call "inline" and what do you expect instead?

blissful halo
#

i would like to have something like this

#

i'm not sure if i miss anything obvious here

worthy jetty
#

You need to decrease the width of the parent element, right now it's the full page's width so it's all on one line

#

you have to control the parent element's width in HTML/CSS

blissful halo
#

ah yes, silly me, that helps
Thank you so much for your time

worthy jetty
#

Of course!

blissful halo
#

sorry, another question!
is the label name on the payment elements changeable?

errant fulcrum
#

Can you be specific - which label name?

blissful halo
errant fulcrum
#

Gotcha - no, there isn't a way to change those labels

blissful halo
#

same with placeholder text too?

errant fulcrum
#

With Payment Element I don't believe there's a way for you to set that either