title: Symfony Form Framework - Best way to implement change password functionality?
body: <p>I'm trying to get my head around the <strong>form framework in Symfony 1.4</strong>. I've read the incredibly <a href="http://www.symfony-project.org/more-with-symfony/1_4/en/05-Custom-Widgets-and-Validators" rel="nofollow noreferrer">detailed section</a> in the 'More with symfony' book, but I'm still a but unsure how to implement a simple 'Change password' functionality.</p>
  
  <p>The requirements are pretty basic,</p>
  
  <ol>
  <li>There'll be two fields, <code>new_password</code>, and <code>confirm_new_password</code>. Both will be input fields.</li>
  <li>The <code>new_password</code> field will be validated to be a string between 6 and 30 characters containing both letters and numbers.</li>
  <li>The <code>confirm_new_password</code> field will be validated to match the <code>new_password</code> field exactly.</li>
  </ol>
  
  <p>Now, presently I implemented this by,</p>
  
  <ul>
  <li>Adding 2 new fields to my form.</li>
  <li>Adding a string validator to the <code>new_password</code> field to check the string length.</li>
  <li>Adding a string validator to the <code>confirm_new_password</code> field to make sure it was filled in.</li>
  <li>And then validating the new password is valid and matches the confirm password in a custom post validator. I did this because I didn't want to validate the <code>confirm_new_password</code> field until the <code>new_password</code> field was valid.</li>
  </ul>
  
  <p>Now <strong>to the point of my question</strong>. After reading the article mentioned above, I'm starting to think I should contain the two fields in either a single widget or in a sub form as they rely upon each other heavily, and one is useless without the other.</p>
  
  <p>I was wondering what peoples thoughts were on this, and if someone had implemented one, how they did it?</p>
  
  <p>Thanks</p>
  
  <p><strong>Note:</strong> There is no <code>current_password</code> field as this is for my admin area.</p>