How to use form validation through Schema Libraries ?
But that each are validated indiidually onChange/Onblur, but not all field at once like it is by default?
6 Replies
correct-apricot•3mo ago
hide the errors unless the field is touched / blurred using the field meta
sensitive-blueOP•3mo ago
interesting... but at the same time, i want all the errors to appears if the user click the submit button
correct-apricot•3mo ago
form.submissionAttempts keeps track of how many times the user has tried, even if it failed. So if it's larger than 0, that also works
alternatively, you can use revalidateLogic so that it waits until a first submission before using it. I can link the docs to that if you'd likesensitive-blueOP•3mo ago
ok, i think i got it working with
field.form.state.isSubmittingcorrect-apricot•3mo ago
that's only while it is submitting, which means it goes back to
false if it encountered an error
what likely happened is that it touched all fields during the submissionsensitive-blueOP•3mo ago
I do like this