N
N
newNoName2022-04-14 21:28:20
React
newNoName, 2022-04-14 21:28:20

How to check all inputs for react validation on click of one button?

How, when clicking on one button, check all inputs for emptiness and correct validation and display errors if the fields are not valid using use formik ???

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
romaro, 2022-04-15
@romaro

https://formik.org/docs/guides/form-submission
You need to hang a handler on the form submission event: If the form is not valid, isValidating will return false.
<form onSubmit={props.handleSubmit}>...</form>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question