#slushy-paymentelement-empty

1 messages ยท Page 1 of 1 (latest)

junior sailBOT
tacit harbor
#

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

river crane
#

slushy-paymentelement-empty

junior sailBOT
tacit harbor
#

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

river crane
#

assume it's empty until it succeeds?

tacit harbor
#

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

river crane
#

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

tacit harbor
#

Yeah that validation isn't a problem, I just need the UX of showing the error to the user, but I can't

river crane
#

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

tacit harbor
#

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

jaunty dew
#

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.

tacit harbor
#

That would be cool ๐Ÿ˜„ a way to run validations on demand would be nice

jaunty dew
#

That's a cool idea for a feature. Like, to be able to build additional validations on top of Stripe's validations.

tacit harbor
#

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