administrator/components/com_xxx/config.xml, add a tab fieldset with child fieldsets, and put a showon on one of the children:<fieldset name="exampletab" label="Example">
<fieldset name="example_general" label="General">
<field name="example_enable" type="radio" layout="joomla.form.field.radio.switcher" default="0" label="Enable">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
</fieldset>
<fieldset name="example_details" label="Details" showon="example_enable:1">
<field name="example_text" type="text" label="Some Text" />
</fieldset>
</fieldset>The "Details" fieldset, including its legend, is hidden while "Enable" is No, and shown again when it is Yes.
The "Details" fieldset stays visible whatever "Enable" is set to. The rendered <fieldset> element has no data-showon attribute.
administrator/components/com_config/tmpl/component/default.php already handles fieldset showon:
$dataShowOn from $fieldSet->showon.showon web asset.But $dataShowOn is never echoed into either <fieldset> tag. showon.js picks up any element with data-showon, so printing the attribute is enough.
Proposed change (two lines in administrator/components/com_config/tmpl/component/default.php):
<?php if (!$isGrandchild && $hasParent) : ?>
- <fieldset id="fieldset-<?php echo $this->escape($name); ?>" class="options-menu options-form">
+ <fieldset id="fieldset-<?php echo $this->escape($name); ?>" class="options-menu options-form"<?php echo $dataShowOn; ?>>
<legend><?php echo Text::_($fieldSet->label); ?></legend> <?php if (!$hasChildren) : ?>
- <fieldset id="fieldset-<?php echo $this->escape($name); ?>" class="options-menu options-form">
+ <fieldset id="fieldset-<?php echo $this->escape($name); ?>" class="options-menu options-form"<?php echo $dataShowOn; ?>>
<legend><?php echo Text::_($fieldSet->label); ?></legend>Applying this locally fixed it. The child fieldset now hides and shows completely, legend included.
The current workaround is to put the same showon on every field inside the fieldset. That hides the fields, but the empty fieldset and its legend stay visible.
| Labels |
Removed:
?
|
||
| Labels |
Added:
No Code Attached Yet
|
||
| Status | New | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-11-02 15:56:50 |
| Closed_By | ⇒ | Ruud68 |
please test #48741