So this is an example XML:
<form>
<fieldset>
<field name="field1" type="text" default="" label="" description="">
<option value="">JSELECT</option>
<option value="1">A1</option>
<option value="2">A2</option>
</field>
<field name="field2" type="text" default="" label="" description="" />
<fields name="group1">
<field name="field11" type="text" default="" label="" description="" />
<field name="field12" type="text" default="" label="" description="" />
</fields>
<fields name="group2">
<field name="field21" showon="noidea" type="text" default="" label="" description="" />
<field name="field22" type="text" default="" label="" description="" />
</fields>
</fieldset>
</form>
I'm trying to toggle field21 in group2 when changing field1.
This just adds the current group:
<field name="field21" showon="field1:2" type="text" default="" label="" description="" />
creates: data-showon="[{"field":"jform[group2][field1]"
This targets another field in another group, but i need the root...
<field name="field21" showon="group1.field1:2" type="text" default="" label="" description="" />
creates: data-showon="[{"field":"jform[group1][field1]"
This was just a try
<field name="field21" showon=".field1:2" type="text" default="" label="" description="" />
creates: data-showon="[{"field":"jform[][field1]"
This is what i need: data-showon="[{"field":"jform[field1]"
I only found a similar question here, but that was a bit different and already solved: https://github.com/joomla/joomla-cms/issues/6744
I dont see if parseShowOnConditions
is solving this.
There is a pull request making this possible, but it wasnt merged into Joomla 3.22: https://github.com/joomla/joomla-cms/pull/30850
Maybe there is another way of getting this to work.
hidden
attribute thus maybe theclass
attribute of the field could be set tohidden
for example on conditions... – Zollie Oct 10 '20 at 8:12