I'm looking into a problem but I don't think there is a solution. Maybe someone has a better idea lets say we have a form with 2 inputs. Form is valid once 2 input value are equals. So I build a custom validator
input.value && input.value === inputOther.value
And set the custom validator for input1 and input2.
My question is: is there a way to trigger validation for a given element?
Having the following scenario:
input1 is set to "a" & input2 is empty: input1 is not valid. <= ok
input2 is set to "b": input1 is not valid & input2 is not valid. <= ok
input1 is et to "b": input1 is valid but input2 is still not valid because validation has not run. <= not ok
input1 and input2 are set to "b": both are valid. <=ok
input1 is changed to "a": input1 is not valid but input2 is still valid <= not OK
Ideally, I would trigger validation on both inputs once one of the 2 changes.
This is a simplified problem. My current is issue is for an event form where startDate < endDate. What would be your recommended solution? I personally would like the possibility to do something like:
$w("input1").triggerValidation() // runs all validators on input1 and update // valid status and messages