title: cakephp password validation
body: <pre><code>var $validate = array(
    'password' =&gt; array(
        'passwordlength' =&gt; array('rule' =&gt; array('between', 8, 50),'message' =&gt; 'Enter 8-50 chars'),
        'passwordequal' =&gt; array('checkpasswords','message' =&gt; 'Passwords dont match') 
    )
  );
  
  function checkpasswords()
  {
     return strcmp($this-&gt;data['Airline']['password'],$this-&gt;data['Airline']['confirm password']);
  }
  </code></pre>
  
  <p>This code is not working and always gives the error message even if they match. Also when i do a edit i get the followoing error as there is no password field. is there any fix</p>
  
  <pre><code>Undefined index:  password [APP/models/airline.php, line 25]
  </code></pre>