#sh3ft
1 messages · Page 1 of 1 (latest)
Stripe Element doesn't have any control over you forms
What you can do is when you click on the confirm/pay button
you validate your form
and then you call stripe.confirmPayment
Is there a way to add a listener to the field that I want so I can see if it's a valid field or an empty field?
You want to add a listener where exactly?
On card number field, card expiry field and on the card cvc field
Here are all the events you can listen for the Stripe Element:
https://stripe.com/docs/js/element/events
is the apove link you share compatible with this PaymentElements?
import { PaymentElement, useElements, useStripe } from '@stripe/react-stripe-js'
Yes
I get the following error if I try that:
Property 'on' does not exist on type 'PaymentElementComponent'.
That's a react Component right ?
Yeah
The guide I shared with you is for Javscript integration
Do we have a react example? apologies I should have mentioned it from the start
You need to refer to this guide then:
https://stripe.com/docs/stripe-js/react#element-components
Yeah I think that will do the trick thanks 🙂