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
I have done several simple validations that are working perfectly but now I need to perform a more complex validation over 3 conditionally required fields with the following logic:
I have 3 fields that are conditionally required based on each others value:
Field A (a belongsTo field) is optional but should be specified if field B is empty
Field B (a belongsTo field) is also optional but should be specified alongside field C if field A is empty
Field C (a string attribute) is optional but should be specified when field B is specified.
In other words one should specify A or (B and C).
Also: A and B and C is not valid
I can not seem to find any example for my use case. I have read about custom validators but I can't seem to make it work for that particular logic.
With custom validation I can partially achieve what I want to but how can I trigger the others field to be validated when a specific field changes ?
The text was updated successfully, but these errors were encountered:
Environment
I have done several simple validations that are working perfectly but now I need to perform a more complex validation over 3 conditionally required fields with the following logic:
I have 3 fields that are conditionally required based on each others value:
In other words one should specify A or (B and C).
Also: A and B and C is not valid
I can not seem to find any example for my use case. I have read about custom validators but I can't seem to make it work for that particular logic.
With custom validation I can partially achieve what I want to but how can I trigger the others field to be validated when a specific field changes ?
The text was updated successfully, but these errors were encountered: