[TYPO3-project-formidable] majix, how to combine multiple clientData values

Jerome Schneider typo3dev at ameos.com
Wed Nov 21 14:25:58 CET 2007


Hi Alexander,

the best solution when it comes to compute client input data is to use 
the ajax events.

this should work:

<renderlet:TEXT name="field_a" label="field a" />
<renderlet:TEXT name="field_b" label="field b" />
<renderlet:BOX name="box_results" mode="h2" />
<renderlet:BUTTON name="btn_multiply" label="Multiply">
	<onclick runat="ajax" params="field_a, field_b">
		<userobj>
			<php><![CDATA[
				
	$aParams = $this->oMajixEvent->getParams();

	$iA = intval($aParams["field_a"]);
	$iB = intval($aParams["field_b"]);
	$iMul = $iA * $iB;
	$sHtml =  $iA . " * " . $iB . " == " . $iMul;

	return $this->aORenderlets["box_results"]->majixSetHtml($sHtml);
				

			]]></php>
		</userobj>
	</onclick>
</renderlet:BUTTON>


You can also cut'n'paste this snippet at http://phpfi.com/277821

Best regards,
Jerome Schneider


Alexander Rose a écrit :
> Hi all,
> 
> first of all: thanks for this great extension!
> 
> I would like to multiply the values of two input fields field_a and 
> field_b and put the result into field_c when some onclick event occurs.
> 
> something naiv like
> 
> $this->aORenderlets["field_c"]->majixSetHtml("clientData::field_a * 
> clientData::field_b")
> 
> does not work...
> 
> is there any way to do this within the formidable framework?
> 
> thanks in advance
> 
> alex


More information about the TYPO3-project-formidable mailing list