I have tried the following exact example in the Joomla documentation:
Showon attribute for list options
<field
name="fielda"
type="list"
label="FIELDA_LABEL"
description="FIELDA_DESC"
>
<option value="editor">TYPE_EDITOR</option>
<option value="text">TYPE_TEXT</option>
<option value="textarea">TYPE_TEXTAREA</option>
</field>
<field
name="fieldb"
type="list"
label="FIELDB_LABEL"
description="FIELDB_DESC"
>
<option value="0">JNO</option>
<option value="1">Option 1</option>
<option
showon="fielda:text,textarea"
value="2">Option 2</option>
<option
showon="fielda:text"
value="3">Option 3</option>
</field>
I rendered the fields with the code:
<?php echo $this->form->renderField('fielda'); ?>
<?php echo $this->form->renderField('fieldb'); ?>
In the documentation it says:
Since Joomla 3.9.0 one can use the showon attribute for option tags in a list field.
But I'm trying in Joomla 4 and seems it doesn't work. All options in fieldb, appear with any option of fielda
Does Showon attribute for list options work with Joomla 4 ?