Re: multiple submit buttons in a form

2008-03-08 Thread Jason

Check out the $param array in your Controller when the submit occurs:

Array
(
...

[form] => Array
(
[b] => Submit
)

...
)

BTW, I changed the 'name' for your submit button to 'b', so it is
different to the edit button. Obviously if the edit button was clicked
you'd see [a] => Edit.


On Mar 8, 8:47 am, bob <[EMAIL PROTECTED]> wrote:
> How can I have multiple submit buttons in a form?
>
> echo $form->create('Form', array('url'=>$url));
>
> echo $form->submit('Edit',array('div'=>false,'name'=>'a','value'=>'edit'));
> echo
> $form->submit('Submit',array('div'=>false,'name'=>'a','value'=>'submit'));
>
> echo $form->end();
>
> in the above, how do i determine which button i clicked on?
>
> thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: multiple submit buttons in a form

2008-03-08 Thread the_woodsman

I believe the name and value of the submit button pressed is usually
passed in POST requests (but doesn't make it into $data unless you
name it correctly).

Check $_POST, or Cake equivalents, to see if your submit button info
was passed along with the request.

I'm sure this has been asked before on this group with a more thorough
explanation, keep searching if you need more info

On Mar 8, 8:47 am, bob <[EMAIL PROTECTED]> wrote:
> How can I have multiple submit buttons in a form?
>
> echo $form->create('Form', array('url'=>$url));
>
> echo $form->submit('Edit',array('div'=>false,'name'=>'a','value'=>'edit'));
> echo
> $form->submit('Submit',array('div'=>false,'name'=>'a','value'=>'submit'));
>
> echo $form->end();
>
> in the above, how do i determine which button i clicked on?
>
> thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



multiple submit buttons in a form

2008-03-08 Thread bob
How can I have multiple submit buttons in a form?


echo $form->create('Form', array('url'=>$url));

echo $form->submit('Edit',array('div'=>false,'name'=>'a','value'=>'edit'));
echo
$form->submit('Submit',array('div'=>false,'name'=>'a','value'=>'submit'));

echo $form->end();

in the above, how do i determine which button i clicked on?

thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---