[TYPO3-formidable] Multiple named submit buttons (or use AMEOSFORMIDABLE_SUBMITTER)?

Martin Terber mail at martinterber.com
Wed Oct 5 20:19:09 CEST 2011


I found out that it is easily possible.
My new typoscript setup is this (w/ initFromTs):

             button_submit = renderlet:SUBMIT
             button_submit {
                 name = button_submit
                 label = Send
             }

             store_data= renderlet:SUBMIT
             store_data {
                 name = store_data
                 label = Store data
             }

This results in two submit buttons:

    <input name="formular[button_submit]" id="formular.button_submit" value="Send" type="submit">
    <input name="formular[store_data]" id="formular.store_data" value="Store data" type="submit">

After submit, the second one can be read from $_POST array.
However, the value for form[button_submit] is not in $_POST. I can live with that.


Am 05.10.2011 19:59, schrieb Martin Terber:
> Hi there, we are rendering one form in many different scenarios in an intranet platform.
> As we are right now in a transition phase from html & php4/piBase coding to Formidable, I am looking for a solution to this function:
>
> Up to now, all form variants have different submit buttons, e.g.:
>
> <input type="submit" value="Notify user" name="notify">
> <input type="submit" value="Store data" name="store_data">
>
> The resulting action is chosen, depending if the regarding value in $_POST is given ($_POST['store_data'] etc.)
>
> I noticed that the name of the Formidable submit button is not transmitted to $_POST (renderlet:SUBMIT)
>
> Can I rebuild this function (multiple submit buttons, different name attribute) in Formidable, and how?
> Or can I utilize the hidden Formidable fields (like AMEOSFORMIDABLE_SUBMITTER or AMEOSFORMIDABLE_ADDPOSTVARS) to switch between submit modes later?
>


-- 
Greets:
Martin Terber
www.martinterber.com


More information about the TYPO3-project-formidable mailing list