0

I use Zend Framework, and I have a form with only two elements: email, and password.

I would like to have two password elements, in doing so the user has to type the password twice. The code should check whether the user typed the exact same password in each password element. Just as a double check. The code below will create a form with the two elements. But without the double check.

$form = new Zend_Form();
        $form->setAction('?action=certificateSettings');
        $form->setView($this->view);

$email= $form->createElement('text', 'licenceEmail')
            ->setLabel('Admin email')
            ->setValue($licenceParams['email'])

$pass = $form->createElement('text', 'licencePass')
            ->setLabel('Admin password')
            ->setValue($licenceParams['password'])
            ->setRequired();


$form->addElement($email)
       ->addElement($pass);

How can I implement this password double check? Where should this double check be validated?

1

1 Answer 1

3

Use the Zend Identical validator http://framework.zend.com/manual/1.12/en/zend.validate.set.html#zend.validate.set.identical

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.