How to delay validation until the submit button is clicked in UI V3 ?
It seems like there is only possiblity of validating in either of blur, change, or input events. But I wanna do it on submit Event only.
5 Replies
Hi @Decisive Lieutenant. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To delay validation until the submit button is clicked in UI V3, you can utilize the
validate-on
prop of the UForm
component. By default, validation is triggered on blur
, input
, change
, and submit
events. However, you can customize this behavior by setting the validate-on
prop to only include the submit
event.
Here's an example of how you can achieve this:
In this example, the validate-on
prop is set to ['submit']
, which means validation will only occur when the form is submitted. This allows you to delay validation until the user clicks the submit button.
For more information, you can refer to the Input events section in the knowledge sources.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@463307450402078720> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@kapa.ai Type '"submit"' is not assignable to type 'FormInputEvents'.
Let me check the knowledge base for you again. One moment! :books:
----------------------
Hmm, I don't know enough to give you a confident answer yet. It seems like there might be a type mismatch issue with the
validate-on
prop. You might want to check the documentation or the type definitions for FormInputEvents
to ensure you're using the correct event names. You can refer to the Input events section for more details.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@463307450402078720> Kapa.ai is still learning and improving, please let me know how I did by reacting below.