[TYPO3-project-formidable] renderlet:BUTTON: Do something if clicked without JS

JéŽrô™me Schneider typo3dev at ameos.com
Sun Mar 15 15:02:17 CET 2009


Hi Hauke,

what you're looking for the the unobtrusive onclick event, described here:

http://formidable.typo3.ug/pastebin/snippet/100.html

Using a combination of renderlet:SUBMIT + onclick + server-event, your 
event will work OK wether javascript is enabled or not.

You'll also find more on the accessibility in Formidable here:
http://formidable.typo3.ug/pastebin/snippet/100.html


Concerning http://bugs.typo3.org/view.php?id=10631,
I think that the reason is that you have to declare runat="server" on 
your event, because if you don't, default runat is client, so Formidable 
will pre-build all the events before including them in the page as 
javascript, thus executing your PHP on the event all the time.


Best regards,
Jerome

Hauke Hain a écrit :
> Hi,
> 
> at the moment I use this:
> <renderlet:BUTTON name="delete" label="LLL:be.delete">
>          <onclick>
>            <userobj>
>              <php><![CDATA[
>                $aRow = t3lib_div::_GP('tx_preview');
>                $GLOBALS["TYPO3_DB"]->exec_UPDATEquery(
>                    "fe_user",
>                    "uid='" . $aRow['uid'] . "'",
>                    array("deleted" => '1')
>                 );
>              ]]></php>
>            </userobj>
>          </onclick>
>    </renderlet:BUTTON>
> 
> Now I want the same functionality realised in another way. Is there one 
> in formidable?
> I would prefer a way without JavaScript.
> 
> One reason I am looking for another possibility is this bug (see the 
> third note (0027693)): http://bugs.typo3.org/view.php?id=10631
> 
> Kind regards,
> Hauke


More information about the TYPO3-project-formidable mailing list