bietkul / react-native-form-builder

Handle your forms in a smart way
MIT License
121 stars 68 forks source link

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

Closed grahamyesfit closed 8 months ago

grahamyesfit commented 6 years ago

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.

bietkul commented 6 years ago

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.