I solved it this way.
NOTE: - $context['wachtwoordA] is the name of the first passwordfield
- $value is the value of the field which it is validating.
- This is the isValid method from my own custom validator
Code:
public function isValid($value, $context = null)
{
$value = (string) $value;
$this->_setValue($value);
if (is_array($context))
{
if (isset($context['wachtwoordA'])
&& ($value == $context['wachtwoordA']))
{
return true;
}
}
elseif (is_string($context) && ($value == $context))
{
return true;
}
$this->_error(self::NOT_MATCH);
return false;
}