FormIt: required validation of a field depending on an other field value

Here is an example of a custom validator from another thread:

In the snippet code you can access the value of the field (the validator is attached to) with $value, to get the values of other fields use $validator->fields["your_field_name"].