title: How to display two password fields in ZF 1?
body: <p>So, I got a small problem with <strong>Zend Framework 1.12</strong> and I don't know how to solve it:</p>
  
  <p>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:</p>
  
  <pre><code>public function init()
  {
      $this-&gt;setName('user');
  
      ... few fields which do work fine ...
  
      $password = new Zend_Form_Element_Password('password');
      $password-&gt;setLabel('Password')
          -&gt;setRequired(true);
  
      $passwordConfirm = new Zend_Form_Element_Password('password');
      $passwordConfirm-&gt;setLabel('Confirm password')
                      -&gt;setRequired(true);
  
      $submit = new Zend_Form_Element_Submit('submit');
      $submit-&gt;setAttrib('id', 'submitbutton');
  
      $this-&gt;addElements(array($id, $username, $prename, $surname, $password, $passwordConfirm, $email, $gender, $submit));
  }
  </code></pre>
  
  <p>However, the form looks like this once it's printed:</p>
  
  <p><a href="https://i.stack.imgur.com/TcdaC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TcdaC.jpg" alt="Dis ma form"></a></p>
  
  <p>When I swap <code>$password</code> and <code>$passwordConfirm</code>, the label of <code>$password</code> is shown. So I assume each passwordfield overwrites the previous one.</p>
  
  <p>How can I display both passwordfields in one form? Or do I really have to build 2 forms for this purpose?</p>