their leader a notification. I want to add a new submit button to the
bottom of the form that, when clicked, will just save the data and not
email their leader.
I've done some research and I've tried the following:
In the view:
$form->submit(__('Save', true), array('name' => 'saveType', 'value' =>
'Save'));
$form->submit(__('Submit for approval', true), array('name' =>
'saveType', 'value' => 'Email'));
In the controller:
if($this->params['form']['saveType'] == 'Save') {
// do save functions
} else if ($this->params['form']['saveType'] == 'Email') {
// do email functions
}
However, I get this message:
Undefined index: saveType
And when I debug($this->params) this is all I get in the form key:
[form] => Array
(
)
Is there some alternate way of having 1 form but 2 different submit
buttons where clicking one button saves the data and clicking the
other saves and emails the data?
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment