Validator to compare fileds values

Hi Guys!

I wanted to create validator that will check current field ( to which validator is added ) value with other field value ( selected by user ).
I’ve achieved most of it. But I stuck in “isValid” function. I dont know how to access other fields values in validator? Is there a way?

The “$values” variable can contain a array. Have a look at the password validator

and how the form for setting a user password is setup in Neos.Neos