There is an โIdenticalโ validator that checks equal two fields, it can be used as follows in the form constructor:
$this->add(array( 'name' => 'password', // add first password field /* ... other params ... */ )); $this->add(array( 'name' => 'passwordCheck', // add second password field /* ... other params ... */ 'validators' => array( array( 'name' => 'Identical', 'options' => array( 'token' => 'password', // name of first password field ), ), ), ));
source share