Zum Inhalt springen

Checkbox disabled mit condition

Erstellt am 9. August 2012 · 2 Antworten · letzte Antwort am 14. August 2012

Tags: Frage

janthelen ·

Hallo,

ich würde gerne eine Checkbox mit Fluid je nach Status auf disabled stellen.
klappt leider nicht:

<f:form.checkbox property="xxx" value="1" id="xxx" 
checked="{xxx.status} > 1" 
disabled="{xxx.status} > 1"
/>

Mit checked funktioniert es, nicht aber mit disabled?

Muss ich den ViewHelper anpassen, wenn ja, wie, oder übersehe ich was?

Was auch nicht klappt, ist eine if-Abfrage im Tag, ungefähr so:

{f:if(condition:'{xxx.status} > 1', then:'disabled="disabled"')}

Arbeite mit Typo3 4.5 und fluid 1.3

LG
Jan

LuP ·

Hallo,

Du warst schon ganz nah dran.

<f:form.checkbox property="xxx" value="1" id="xxx" 
  checked="{xxx.status} > 1" 
  disabled="{f:if(condition: '{xxx.status} > 1', then: 'disabled')}"
/>

VG,
LuP