A plugin to validate a field depending on another field's value I have an Assets field which I want to be required only if a separate Lightswitch field on the same Entry is 'on'. I'm currently trying to implement this with a simple plugin that creates a custom field type (along these lines).

However, in my Field Type's validation() method I can't work out how to access the Lightswitch field's value on this same Entry, in order see if it's 'on' or not.
In your FieldType you have $this-&gt;element available, representing the Element the field is in. If you use $this-&gt;element-&gt;lightSwitchHandle you can access its value.