You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes it is required to immediately validate a field if the value of another field has been changed. E.g. having two date fields, where one must be before/after the other, it is desired to validate one date based on the others current value.
Prefered API
Option 1
Validate a field, if the value of a specific other field changed:
In this case it could also be desried to target multiple other fields. One way is to chain the validation triggers, the other one is to pass an array instead of a single value:
But this doesn't look intuitive enough and on top of that it is not really fluent. It might be better to use a more generic approach, where triggers can be anything:
But I'll keep the ticket open for now, since it might be worth implementing triggers directly in react-fluen-form, because the solution above might not be straighforward. Also it could get quite complicated for the users to implement if the form is really big and has a lot of inter-field-dependencies.
Problem Statement
Sometimes it is required to immediately validate a field if the value of another field has been changed. E.g. having two date fields, where one must be before/after the other, it is desired to validate one date based on the others current value.
Prefered API
Option 1
Validate a field, if the value of a specific other field changed:
In this case it could also be desried to target multiple other fields. One way is to chain the validation triggers, the other one is to pass an array instead of a single value:
Option 2
Validate a field, if any value in the form changed:
It might even make sense to implement both Options.
The text was updated successfully, but these errors were encountered: