#majks_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1268860588294013034
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- majks_code, 19 hours ago, 19 messages
๐ happy to help
hello
where did you get that code from?
newPaymentElement.on('change', (event) => {
console.log(event)
console.log(event.error)
})
This one?
because I don't think the event has an error property
oh! this is the cardElement
not the paymentElement on change event
aaaa oh okay
Is there way to get error messages? from paymentElement
async checkIfStripeFormValid() {
const { error } = await this.stripeElements.submit()
if (error) {
this.stripeErrorMessage = error.message
return false
}
this.stripeErrorMessage = null
return true
},
https://docs.stripe.com/js/element/events/on_change?type=paymentElement doesn't provide an error object on the event
I know this but I do not want to make calls for each time user types field
you shouldn't handle input validation for paymentElement
unfortunately submitting the element is the only way to get the error in this case
let me know if you need any more help