Is there a declarative way to add custom async validations for an specific field?
I'm trying to add server side validations for an specific field that run whenever a field value changes and the suggested solution I found is allow the user to submit the whole form, validate it in the server side, return the result and use updateInputsWithError to set the errors in the input, if any. This could work well is not the best from the UX perspective.
Another solution I can think of could be use the onChange event on the Formsy wrapped component to dispatch the needed server side validation, but this sounds a bit hacky, and since formsy already has a great custom validations support would be wonderful if I can use that.
There is a PR (christianalfoni/formsy-react#408) in the old repo that was discarded because it uses Promises, but it's like 2 years old and things have changed since then.
Any thoughts?. Thanks.
Is there a declarative way to add custom async validations for an specific field?
I'm trying to add server side validations for an specific field that run whenever a field value changes and the suggested solution I found is allow the user to submit the whole form, validate it in the server side, return the result and use updateInputsWithError to set the errors in the input, if any. This could work well is not the best from the UX perspective.
Another solution I can think of could be use the onChange event on the Formsy wrapped component to dispatch the needed server side validation, but this sounds a bit hacky, and since formsy already has a great custom validations support would be wonderful if I can use that.
There is a PR (christianalfoni/formsy-react#408) in the old repo that was discarded because it uses Promises, but it's like 2 years old and things have changed since then.
Any thoughts?. Thanks.