#jeremy-cardelement-style

1 messages · Page 1 of 1 (latest)

dense pebbleBOT
idle shale
#

jeremy-cardelement-style

sharp fiber
#

So is there a way of making text labels appear above each of the fields?

idle shale
#

If you use the default CardElement then no, it's a single line input element and you can't control its exact layout. But there's a way to split each field in separate elements yes.
But again you really really should just switch to PaymentElement and ignore the CardElement entirely

sharp fiber
#

Hmm - will that require a big rewrite of my Javascript code though? Also, in my client's application, they only want to offer the chance for the customer to enter card details - so we'd need to prevent it showing Apple Pay and so forth...

idle shale
#

Most businesses think that, but then they regret it. I'm really curious why a business would actively want to prevent real customers from paying quickly with Apple Pay for example

Ultimately, you can do what you want with split fields. See example 3 here https://stripe.dev/elements-examples/ for example

sharp fiber
#

Thank you. 🙂