#HS
1 messages · Page 1 of 1 (latest)
hello! there's no standalone field for name only
Thanks, what's the best recommended way to capture the name in that case? If I add a new text field (outside of elements), I assume
- the design wouldn't match
- StripeJS will not handle the validation
- Is it possible to disable the name field in address element after that?
you should create your own text field. You can update your own design to match that of Stripe Elements. I don't recall that StripeJS validates the name - what are you trying to validate? If you're using the Payment Element, you can set it to never collect the name : https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails-name
Validation - Just the usual StripeJS validation, if it's empty, it will display the error message underneath that specific field. So, I assume it won't be doing that for that custom name field?
Thank you for that link.
Do you know if there are any plans or adding a name field as part of Elements?
Payment Element collects the name when it's required. You can build your own validation to check if the input field is empty if you want to use your own input field
if you want to have the option to always collect a name, I'd suggest writing to https://support.stripe.com/?contact=true to explain your use cases/feature requests as that helps the product team capture demand for prioritisation
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Payment Element collects the name when it's required.
Can you please expand on this? How does that work? Is it different from the Address element name field?
Under what cases/config does it collects the name?
Some payment methods require a billing name, I don't recall which exact payment method off the top of my head right now