#Chhay-card-number-element

1 messages ยท Page 1 of 1 (latest)

haughty quiver
#

๐Ÿ‘‹ Happy to help

#

What kind of validation are you referring here?

surreal needle
#

Is it possible to display the Required message under the CardNumber ?

haughty quiver
#

Which integration are you using? Payment Element or CardNumberElement only?

surreal needle
#

CardNumberElement, CardExpiryElement, CardCvcElement

haughty quiver
#

Let me check how to do the validation on individual element

haughty quiver
#

You can use "event.complete" to validate whether the field is completed before confirming the card

surreal needle
#

yes, I can do it on event change

#

but what if the user submit the form without touching those fields, how the event change happen?

haughty quiver
#

if the user doesn't touch the field, it means that the form is empty and you can prompt the empty error accordingly

surreal needle
#

So it means that we need to handle the React State "Required Fields" by our own

#

there is no any options in CardElement?

haughty quiver
#

CardElement and PaymentElement do the validation whereas CardNumberElement alone doesn't

#

The state for individual element will be maintained on your side

surreal needle
#

THank you boss

#

have a greate day

#

!!

haughty quiver
#

No problem! Happy to help ๐Ÿ™‚