[TYPO3-project-formidable] Executing Javascript just before submitting (handling multi pages forms)
mperrin at stratis.fr
mperrin at stratis.fr
Tue Jan 16 11:17:23 CET 2007
Hi,
First of all, I would like to thanks the developers of the Formidable
project. I have been testing this extension since yesterday, and I think
this is an incredible way to design forms. I am happy to find on the Typo3
API some habits I had with PEAR (formbuilder, dataobject
).
With the help of the documentation by example, I started to test the
functionalities of this API and I tried to implement a multi page form.. and
I have some questions :-)
1/ I wonder if there is a way to execute some javascript just before
submitting the form depending on the submit button pressed.
2/ In fact, I am looking for a way to handle multiple form pages. The way I
do is very simple :
- 2 submit buttons : back / next
- 1 hidden input element named step
- Save form data in session when submitting the form before the
final step
I just want to change the value of the hidden input element depending on the
submit button pressed.
So I added an onclick event handler on the submit button.
However, doing this seems to disable the submitting of the form. A look at
the API in the file class.tx_rdtsubmit.php confirms that behavior:
$sEvents = parent::_getEvents();
if($this->oForm->_navConf("/onclick",
$this->aElement) === FALSE) {
[
]
}
return $sEvents;
So I tried to concatenate the onclick value with the form submitting action:
$this->oForm->oRenderer->_getFullSubmitEvent() (hack of the
class.tx_rdtsubmit.php file)
This works, but now, my data handlers are not executed.
So my question: is it the good way to proceed?
Best regards,
Mickaël PERRIN
04 98 01 26 20 - 06 87 11 82 73
perrin at stratis.fr
______________________________________________
Stratis
agence conseil en communication publique
ZI Toulon Est - BP 243 - 83078 Toulon Cedex 9
Tél. : 04 98 01 26 26 - Fax : 04 98 01 26 25
Europarc de Pichaury - Bât. B5 - 13856 Aix-en-Provence Cedex 3
Tél. : 04 88 71 88 28 - Fax : 04 88 71 88 72
______________________________________________
voir... écouter... découvrir >> le nouveau site internet Stratis...
<http://www.stratis.fr/> http://www.stratis.fr
More information about the TYPO3-project-formidable
mailing list