I have a problem with identical validator of zend framework. I have two elements (password and verify password) and wanna make sure they are identical. But identical validator does not work for me. The tokens are always not match:
class Form_MemberRegisterationForm extends Zend_Form
{
public function init()
{
$password = $this->createElement('password', 'password1');
$password->setLabel('Password:');
$password->setRequired(TRUE);
$password->setAttrib('size', 30);
$password->setErrorMessages(array ("isEmpty" => "Invalid Password!" ));
$this->addElement($password);
//
$confirmPswd = $this->createElement('password',
'confirmPassword');
$confirmPswd->setLabel('Verify password:');
$confirmPswd->setAttrib('size', 30);
$confirmPswd->addValidator('identical', false,
array ('token' => 'password1' ));
$this->addElement($confirmPswd);
What I am doing wrong?