Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
[#33295] Adding the "showon" & hiddenLabel feature to JForm #3379
This is like PR #3127, just in sync with the latest changes, and it also adds support for hidden labels on xml level. Here is the copy of the test instructions/description from the previous PR:
In the Joomla Global Configuration we use showon attribute to show/hide certain fields based on the state of a "parent" field. You can see this for example with the FTP settings where the settings itself only show when "Enable FTP" is set to "Yes". It's also available for Component settings.
This PR takes this feature to the JForm so it can be used in any xml file.
You can add a showon attribute to any config field you want to hide. For example in
This will only show the "Label position" setting only if the "Show Label" is set to "Yes" (which has the value 1).
This was referenced
Mar 27, 2014
There's a problem when
<fieldset> <field name="has_full_image" type="radio" > <option value="yes">JYES</option> <option value="no">JNO</option> </field> </fieldset> <fields name="images"> <field name="image_fulltext" showon="has_full_image:yes" /> </fields>
because the attached rel attribute is generating id from the source field:
<div class="control-group showon_yes" rel="showon_jform[images][has_full_image]"> ... </div>
Dirty workaround is to place both field withing same group
The easier will be to allow the "showon" to specify the other ID ; not complicated at all.
PS : It's a "he" :) I'm also know as Jerome from the HikaShop team.