Any validation rule can be disabled if the defined disableIf function returns true. Any validation rule can only be enabled if the defined enableIf function returns true.
Validation Result:
valid
![validationresult](/react-validatable-form-demo/valid.png)
Current Rules
[
{
"path": "val1",
"ruleSet": [
{
"rule": "required",
"disableIf": e=>e.disableVal1Rule
}
],
"dependantPaths": [
"disableVal1Rule"
]
},
{
"path": "val2",
"ruleSet": [
{
"rule": "required",
"enableIf": e=>e.enableVal2Rule
}
],
"dependantPaths": [
"enableVal2Rule"
]
}
]