Closed FrischBlau closed 2 months ago
Both foo == 'bar'
and foo[] == 'bar
would be wrong. foo
is the correct variable name, but since in your case it is a checkbox with multiple options, it is an array of values, not single value.
You need to use
in_array('bar', foo)
Note: in_array
(and in
) are features of the ExpressionLanguage
that are available by default in Symfony 6.4 (Contao 5). However, terminal42/contao-conditionalformfields
also adds this functionality manually:
Hi,
Checkboxen werden in Version 3.11 nicht unterstützt (siehe auch https://github.com/terminal42/contao-conditionalformfields/issues/2#issuecomment-1834066056) In älteren Versionen ging das. Contao macht bei den Checkboxen aus dem Feldnamen "foo" -> 'name="foo[]"' Eine condition wie "foo == 'bar'" greift damit nicht und "foo[] == 'bar'" ist als Eingabe nicht möglich.
Schönen Nachmittag