Hi guys,
I’m trying to validate two numbers with the core compare validator, but it doesn’t work.
Here are my rules:
[['startYear', 'endYear'], 'integer', 'min' => 1900, 'max' => $this->maxYear],
['startYear', 'compare', 'compareValue' => 'endYear', 'operator' => '<='],
Both field are associated with input of type number.
On the client side as soon as I enter a value in startYear, the error message appears and it won’t dissapear even if I set endYear to a value greater than startYear.
If I disable javascript to test the server side validation, it’s doing nothing.
Do I have something wrong with my rules? I know I could do custom validator but I’d prefer using the core one.
Thanks,
Alex