The FormInstance has a method validateFields: (nameList?: NamePath[]) => Promise
which can be used to check if a field/all fields of the form are valid or not. This also updates the UI to display error messages/feedback on the form.
However there could be use cases where we just need to know if the form is valid or not without displaying any feedback/errors. (e.g: displaying form for the first time with pre-populated data from external source etc.)
As an example @ the CAB https://codesandbox.io/s/bitter-frost-btmsy
When I click on the Validate
button, I would like to know if the form is valid or not without showing the errors/feedback on the UI.
But right now the this is not possible.
This can be useful to let's say enabling/disabling Submit button etc.
May be we can add an option/flag to the validateFields to allow checking the form is valid or not without any UI errors/feedback.
e.g: validateFields: (nameList?: NamePath[], options?: { showErrors?: boolean }) => Promise
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too