I haven t tried two forms with the same inputs, but this works for two forms with different inputs. I don t see why it shouldn t work for your needs.
View:
Make sure each submit button has a name value so that $this->params can identify it.
//first form ...
<?php
$profile_options = array( label => edit profile ,
name => form1 );
echo $this->Form->end($profile_options);
?>
//second form ...
<?php
$password_options = array( label => edit password ,
name => form2 );
echo $this->Form->end($password_options);
?>
Controller action:
Use $this->params to test for each form submission
if(isset($this->params[ form ][ form1 ])){
$this->User->set($this->data); //necessary to specify validation rules
if($this->User->validates(array( fieldList => array( email )))){
$this->User->saveField( email , $this->data[ User ][ email ]);
}
}
elseif(isset($this->params[ form ][ form2 ])){
//same deal for second form
}