In each forms class that you define set the name format for each form
differently. For example in a forms configure() method:

$this->widgetSchema->setNameFormat('form1[%s]');

The second form give it a different name format. Then in the action that
recieves the post:

if ($request->isMethod('post'))
{
  if ($request->hasParameter('form1')) //NOTE: without the [%s] portion
  {
    $form1 = new Form1();
    $form1->bind($request->getParameter('form1'));
    //All the other code here to process form1
  }
  else if ($request->hasParameter('form2'))
  {
    $form2 = new Form2();
    $form2->bind($request->getParameter('form2'));
    //All the other code here to process form2
  }
}

Hope that helps :)

On Wed, Oct 13, 2010 at 8:37 AM, Parijat Kalia <[email protected]>wrote:

> Hi everyone,
>
> I have a page with a form  [?], and this page actually has 2 operations
> possible in it. So essentially multiple buttons are required, submit button
> 1 carries out function 1 of the form, submit button 2 carries out some other
> task. So essentially I think the answer is 2 forms, the way I think this can
> be made possible is that each button has an onsubmit javascript that causes
> form.submit that causes that particular form to be posted. But how do I
> retrieve this information in the actions view???? It is easy to tell in the
> template what form is being posted. But in the action, I am not sure how I
> can go about differentiating.
>
> Any clues fellow human beings?
>
> Regards,
>
> Parijat
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<symfony-users%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

<<328.png>>

Reply via email to