[TYPO3-project-formidable] How to have 2 submit btn with 2 different actions ?

Manuel Rego Casasnovas mrego at igalia.com
Mon Jun 25 15:39:09 CEST 2007


Hello.

You can use two submit buttons with different names:
<renderlet:SUBMIT name="btnsubmit1"/>
<renderlet:SUBMIT name="btnsubmit2"/>

And you can use an actionlet with the a piece of code like:
    $formData = t3lib_div::_GP('my_form_id');
    $button = $formData['btnsubmit'];
    if (isset($formData['btnsubmit1'])) {
         echo "BUTTON 1 PUSHED";
    } elseif (isset($formData['btnsubmit2'])) {
         echo "BUTTON 2 PUSHED";
    }

Bye,
   Rego

-- 
Manuel Rego Casasnovas
Computer Science Engineer
mailto:mrego at igalia.com
Tel: +34 986 10 76 10
Fax: +34 981 91 39 49
Igalia - http://www.igalia.com


Jérémy Lecour escribió:
> Hi,
> I'd like to have a form with 2 different submit buttons, each one making a
> different action.
>
> What would be the best way to do this ?
>
> I've tried to put 2 submit renderlets, each one with it's own name. I've
> even tried to add a <data><value> in the renderlet, but when I submit, the
> getFormData() gives axactly the same data, without any reference to the
> submit button.
>
>   


More information about the TYPO3-project-formidable mailing list