I'm building a component that, among other fields, contains "title" and "text" fields. The business logic is:
- If both fields are empty, that is OK
- If both fields are populated, that is OK
- If one field is populated, but the other isn't it is NOT OK
The request is that this show up as field validation errors. I know I can write this complex logic using item validators, but item validators won't show errors in experience editor for the page because the item is a component, hence the request for field validators.
Is it possible to build a field validator that checks the value of another field on the item?
Some pretty good suggestions were listed in the comments below. At the end of the day, we ended up making this into a controller rendering and handling validation logic in there. We additionally put an item validator on the component itself to prevent it from going through workflow.