By default, invariant validators can only validate values within the same schema. This limitation comes all the way from zope.interface.
A real design mistake might be that, in z3c.form, data extraction is tighly integrated with validation, thus, calling data extraction within any validator could cause infinite recursion.
Anyway, if you know, what to look for, you can manually extract the field you need for the validation:
<adapter factory=".behaviors.MyValidator" />
from z3c.form import validator
from zope.interface import Invalid
def validate(self, value):
fieldsets = dict([(group.__name__, group)
for group in self.widget.form.parentForm.groups])
other_value = fieldsets['myfieldset'].widgets['otherfield'].extract()
raise Invalid('Validation error')
I agree that it's unfortunate, that you need to know, in which fieldset the dependent field is and what's its complete name (prefixed with the behavior interface).