#slushy-paymentelement-empty
1 messages ยท Page 1 of 1 (latest)
Example of what i'm trying to fix, you can see the CVC is empty and the form has ran onBlur for the inputs to validate the others but not the CVC, and I tried to force the input to run onChange but it doesn't seem to work
slushy-paymentelement-empty
You can use the complete property on the change event @tacit harbor , see https://stripe.com/docs/js/element/events/on_change?type=paymentElement#element_on_change-handler-complete
Yeah I can check when it is changing, but I can't make the error display if any of the required fields are empty until the user types in it
assume it's empty until it succeeds?
I want to do this with code, without the user typing into a field already, e.g in that picture when finishing typing into card number if the user clicks "submit" outside the form then all the other fields would be showing the error, but CVC isn't showing anything
like it wouldn't be complete on load
ah also change is called on load
so you know for a fact if it's complete right there
Yeah that validation isn't a problem, I just need the UX of showing the error to the user, but I can't
I don't get it I'm really sorry, what does "the UX of showing the error" mean? You have no way to control the parts of PaymentElement
all you can do is show a separate string/error message and disable your own pay button
Yeah that's the problem, I want to show the error for CVC in that picture but I can't force it to show
clients are complaining the empty field is not obvious enough that the input is required because it has no error, which is weird but that's what they want
Hi there ๐ taking over, as my colleague needs to step away
Give me a few minutes to get caught up.
It sounds like you've run into a limitation of the current UI. If you'd like, I can submit this as feedback to the Payment Element product team. Aside from that, it doesn't look like there's really a workaround right now.
That would be cool ๐ a way to run validations on demand would be nice
That's a cool idea for a feature. Like, to be able to build additional validations on top of Stripe's validations.
Yep ๐ at the minute all I would need is some way to run like form.validate() which would validate all the inputs and if there's a problem with any of them the error would display, e.g This card number is incomplete displays if you've typed but the card number isn't complete, I'd want that to be available if the input is empty also