I have a custom validator, where I am validating two input fields. These two input fields are dependent of each other, a time start field and a time end field. When both are filled out I need to validate if there are any time intervals conflicting with the chosen. If there are such intervals, I would like to add an error both input fields, but this obviously doesn’t work:
My own validator is exactly what I’m doing. In this validator I would like to add more than one error at a time. I.e. I would like to do something like
The reason is that I must validate if a time interval is legal or not. An illegal time interval interferes with other registered time intervals. For instance if there is a registered time interval, say 9.00-10.00 and a user types in the interval 8.00-11.00 this is illegal as it overlaps. But I don’t know if it’s 8.00, 11.00 or both that is wrong. Therefore I would like to mark both as having error. Because if I in my validator choose to say 11.00 is wrong and the user changes 8.00 to 10.30, then this interval is not longer illegal, but the validator won’t register this case as legal.