How to verify password field in zend form?

前端 未结 7 1315
旧巷少年郎
旧巷少年郎 2021-02-04 09:39

In my form, I\'m trying to verify that the user fills in the same value both times (to make sure they didn\'t make a mistake). I think that\'s what Zend_Validate_Identical

7条回答
  •  [愿得一人]
    2021-02-04 09:56

    $token = Zend_Controller_Front::getInstance()->getRequest()->getPost('password');
    $confirmPassword->addValidator(new Zend_Validate_Identical(trim($token)))
                      ->addFilter(new Zend_Filter_StringTrim())
                      ->isRequired();   
    

    Use the above code inside the class which extends zend_form.

提交回复
热议问题