I created a form to add the user to the database and make the user available for login.
Now I have two password fields (the second is for checking the first). How can I add a validator for this kind of validation in zend_form?
This is my code for two password fields:
$password = new Zend_Form_Element_Password('password', array( 'validators'=> array( 'Alnum', array('StringLength', array(6,20)) ), 'filters' => array('StringTrim'), 'label' => 'Wachtwoord:' )); $password->addFilter(new Ivo_Filters_Sha1Filter()); $password2 = new Zend_Form_Element_Password('password', array( 'validators'=> array( 'Alnum', array('StringLength', array(6,20)) ), 'filters' => array('StringTrim'), 'required' => true, 'label' => 'Wachtwoord:' )); $password2->addFilter(new Ivo_Filters_Sha1Filter());
php validation zend-framework zend-form
Ivo Trompert
source share