final-form / react-final-form

🏁 High performance subscription-based form state management for React
https://final-form.org/react
MIT License
7.38k stars 480 forks source link

How to trigger partial validation inside a form #405

Open vagusX opened 5 years ago

vagusX commented 5 years ago

Are you submitting a bug report or a feature request?

I am not sure, but I cannot found any docs about this. the formApi didn't expose validation related methods.

What is the current behavior?

My situation is one registeration form, there is a captcha is required, so when click get captcha code must trigger a phone number validation, but this validation is not cover whole form only for phone number. How could I get this?

What is the expected behavior?

Trigger a partial validation for values inside a form

Sandbox Link

Edit 🏁 React Final Form - Simple Example

What's your environment?

both lastest version

Other information

khaphannm commented 5 years ago

Same problem that i want to deal with. I provide two ways for registration (phone and email) in one Form. I put those Fields in Tabs component. When the Tab Phone is selected, I just want to validate for phone 's fields, otherwise for Email Tab. Please suggest me

burtek commented 5 years ago

@khapnm15dh110042 your validator could explicitely return undefined when the other tab is selected

michaelgmiller1 commented 4 years ago

+1 this would be great to have