[TYPO3-mvc] Fluid: how to render a multiple-select field as checkboxes?

François Suter fsu-lists at cobweb.ch
Mon Apr 4 18:12:57 CEST 2011


Hi all,

I'm currently working on an extension with FE input capabilities. One 
particular field is a select-type field (as defined in the TCA) with a 
list of options, whose rendering (in the FE) should be checkboxes. I 
currently have the following in my Fluid template (omitting labels and 
such):

<f:form.checkbox property="liquidType" value="blood" checked="{0: 
incident.liquidType} == {0: 'blood'}" id="tx_latourrisk_liquidType_blood" />
<f:form.checkbox property="liquidType" value="fluid" checked="{0: 
incident.liquidType} == {0: 'fluid'}" id="tx_latourrisk_liquidType_fluid" />

With this setup it doesn't work if both checkboxes are checked, only the 
second value is taken into consideration when submitting the form. Is 
there a way to make it so that Fluid keeps both values? If yes, can the 
"checked" evaluation be made to work too (as it will obviously not work 
if the value is "blood,fuild")?

Or is my only hope to use a form.select view helper?

Cheers

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch


More information about the TYPO3-project-typo3v4mvc mailing list