bietkul / react-native-form-builder

Handle your forms in a smart way

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I know if the form has invalid input values?

grahamyesfit opened this issue · comments

I'm using autoValidate. On my submit, how can I check to see if any of the fields are invalid? (e.g. empty when required). I was hoping for a method on the form generator called isValid, or something.

Also, the field validation doesn't fire until I go in the field and type something first, which isn't particularly useful when using the required attribute.

For now there is only one method to check your form validity is that you need to access the form state by using ref, so whenever you want to check the validity just iterate through the state fields & check the error entity.
I'm working on it & soon there will be a better solution for this problem.