Multiple Subform field in module - add multiple items at once

by Marco   Last Updated October 18, 2019 10:10 AM

I have a mutliple subform field with radio buttons. All other fields load by showon of the related parent radio select.

If there was added more than one item without saving successively, the radio buttons-state transferred to all items and the showon items are only merged to the first one.

This issue appears only by adding multiple items at once.

enter image description here

<field name="field-name" type="subform"
    formsource="modules/mod_myimage/forms/test1.xml" multiple="true"
label="Subform Field" description="Subform Field Description" />

    <field name="myradiovalue" type="radio" default="0" label="Select an option" description="" class="btn-group btn-group-yesno">
        <option value="1">Heading</option>
        <option value="2">Content</option>
        <option value="3">Button</option>
        <option value="4">Image</option>

It is clear why this happens without unique id before saving, but how to fix this?

<label for="jform_params__field_name__field_nameX__myradiovalue2" id="jform_params__field_name__**field_nameX**__myradiovalue2-lbl" class="btn">Button</label>
Tags : subform showon

Related Questions

Updated March 02, 2016 01:04 AM

Updated August 25, 2016 08:04 AM

Updated June 19, 2017 15:10 PM

Updated February 02, 2018 13:10 PM

Updated March 12, 2019 17:10 PM