如何在ZF 1中显示两个密码字段? [重复]

This question already has an answer here:

So, I got a small problem with Zend Framework 1.12 and I don't know how to solve it:

I got a userform for a rather simple registration. However, I want it to display 2 password fields, one for the password and one for the confirmation. Obviously, I want it to be password fields instead of text fields, so I did the following:

public function init()
{
    $this->setName('user');

    ... few fields which do work fine ...

    $password = new Zend_Form_Element_Password('password');
    $password->setLabel('Password')
        ->setRequired(true);

    $passwordConfirm = new Zend_Form_Element_Password('password');
    $passwordConfirm->setLabel('Confirm password')
                    ->setRequired(true);

    $submit = new Zend_Form_Element_Submit('submit');
    $submit->setAttrib('id', 'submitbutton');

    $this->addElements(array($id, $username, $prename, $surname, $password, $passwordConfirm, $email, $gender, $submit));
}

However, the form looks like this once it's printed:

Dis ma form

When I swap $password and $passwordConfirm, the label of $password is shown. So I assume each passwordfield overwrites the previous one.

How can I display both passwordfields in one form? Or do I really have to build 2 forms for this purpose?

</div>

You should choose different name for password confirm, eg

$passwordConfirm = new Zend_Form_Element_Password('passwordconfirm');