Field validator error

Hello !
I have 2 password fields on my form: password and passwordConfirm
And for the 2-nd field i use a Groovy expression validator with this params : return password.equals(field_passwordConfirm)
(password is a text variable that takes value of field_password) .Independently the values of fields are equals or not bonita gives me my validators error text .
How can i solve it?

Hi,
1-you must create a validator in the form level.This validator must have Groovy expression as Type.
2-In Parameter field, you must choose Script in the editor expression and put a code similar to the following:
if(!field_password.equals(field_passwordConfirm)){
return false;
}else{
return true;
}
3-In the Error message field, you put the error message you want to show to the end user.
Hope it helps

Karim