formsy-react icon indicating copy to clipboard operation
formsy-react copied to clipboard

Form.getErrors()

Open ionutt opened this issue 6 years ago • 3 comments

Is there a way to get all the errors from form? Or at least to get the field with error?

ionutt avatar May 07 '18 09:05 ionutt

I need the same thing.

ekv88 avatar May 11 '18 09:05 ekv88

I find a solution for that. You can iterate all the fields on the form ( inputs property ) and get all the errors. I needed to find the first field with error because I need to focus on that field.

ionutt avatar May 11 '18 10:05 ionutt

Good solution, but I don't like how this is working internally. Validation errors live in form field state and we call field's setState() from from via ref. Might be a good idea to look into moving this state into the form and passing it down to fields for 2.0.

MilosRasic avatar May 21 '18 16:05 MilosRasic