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
flat-fuchsia•2w ago
hide the errors unless the field is touched / blurred using the field meta
vicious-goldOP•2w ago
interesting... but at the same time, i want all the errors to appears if the user click the submit button
flat-fuchsia•2w 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 likevicious-goldOP•2w ago
ok, i think i got it working with
field.form.state.isSubmitting
flat-fuchsia•2w 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 submissionvicious-goldOP•2w ago
I do like this