#sadness-elements

1 messages ยท Page 1 of 1 (latest)

cunning kiln
short snow
#

why is that a problem?

#

like you have a <form> with a submit button, naturally the event will happen

#

you'd use preventDefault to stop the form submitting and then can show validation errors. For example you call stripe.confirmCardPayment and if there's an error you can show them

cunning kiln
#

but i can't :/

#

I want to show this red card when validation fails

frigid orchid
#

It will happen when you call stripe.confirmCardPayment

cunning kiln
#

to create payment method and send it to the server

frigid orchid
#

Same thing

short snow
#

yeah the code I shared uses createPaymentMethod even, and does exactly this.

#

sadness-elements

cunning kiln
#

ok it seems to work ๐Ÿ™‚ but i have another question: is there a way to set the card element status to invalid?

#

manually