下面的代码段不会提醒“密码不匹配”消息。
$password = new Zend_Form_Element_Password('password');
$password->setDecorators($elementDecoration);
$password->setLabel('Password')
->addFilter('StripTags')
->addFilter('StringTrim');
/* 密码确认 - 只需将令牌部分设置为密码字段名称 */
$confirmPswd = new Zend_Form_Element_Password('conf_password');
$confirmPswd->setDecorators($elementDecoration);
$confirmPswd->setLabel('Confirm Password:');
$confirmPswd->setLabel('Confirm Password:');
$confirmPswd->setAttrib('size', 35);
$confirmPswd->setRequired(true);
$confirmPswd->addValidator('Identical', false, array('token' => 'password'));
$confirmPswd->addErrorMessage('The passwords do not match');