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

David Bruchmann david at bruchmann-web.de
Mon Apr 4 19:56:34 CEST 2011


Hi,

did you check the value of checked?
In your case it should be more than 1 because:

<API:>
You can have between 1 and 10 checkboxes and the field type in the 
database must be an integer. No matter how many checkboxes you have each 
check box will correspond to a single bit in the integer value.
</API>

Greets,
David

Am 04.04.2011 18:12, schrieb François Suter:
> 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
>



More information about the TYPO3-project-typo3v4mvc mailing list