views:

120

answers:

2

Hi there,

In Zend Framework (1.10) i want to check if two input fields are identical I have the following code in my form:

$this->addElement('password', 'password', array(
        'label'      => 'Wachtwoord:',
        'required'   => true
    )
);

$this->addElement('password', 'verifypassword', array(
        'label'      => 'Bevestig wachtwoord:',
        'required'   => true,
    )
);

I already tryed the "identical" validator, but I did'nt got it to work.

+1  A: 

You can use a custom validation filter to accomplish this.

http://framework.zend.com/manual/en/zend.form.elements.html

The documentation outlines what you are describing, under Note: Validation Operates On Filtered Values with a class called My_Validate_PasswordConfirmation

Joshua Smith