How to trigger validation on submit (to show errors)?
onChange and show my errors only if the field is blurred like this:This works fine and also revalidates if I change the field with an error, but it doesn't validate if the fields weren't touched yet and I hit the submit button.
How can I trigger this or which fields do I need to check within the
getFieldError function? When I click the submit button it should automatically trigger validation on every field and show the error message there.So what I want is basically:
- show error message on blurred fields
- hide error when typing inside error fields and value is valid
- don't validate fields while typing that weren't touched
- validate every field if form is submitted, regardless touched or not