I created created a toggle switch demo with couple of elements. Those elements were however added dynamically by Freemarker - i.e. values of attributes like id for<input type="checkbox" ... id=""> and value of atribute for in <label for=""> were automatically filled in by Freemarker.
The problem is my toggle switch buttons are not working i.e. when I click on them nothing happens.
I really don't know what is the reason behind that all, but I tried to add one element manually i.e. without using Freemarker and suprisingly this manually added toggle switch worked FINE. But I still don't understand why are toggle switch buttons not working for elements added via Freemarker.
Here is my .FTL:
<divclass="os_subscribe-wrap"><!-- This element below was added manually for testing --><spanclass="os_section-name">TEST</span><inputtype="checkbox"class="os_section-check"name="test"id="test"/><labelclass="os_section-slider"for="test"></label><!-- These elements below will be added automatically by Freemarker --><#list tags as tag>
<#if tag.hasId??>
<spanclass="os_section-name">${tag.text}</span><inputtype="checkbox"class="os_section-check"id="${tag.text}"/><labelclass="os_section-slider"for="${tag.text}"></label></#if>
</#list>
</div>
I created created a toggle switch demo with couple of elements. Those elements were however added dynamically by Freemarker - i.e. values of attributes like
id
for<input type="checkbox" ... id="">
and value of atributefor
in<label for="">
were automatically filled in by Freemarker.The problem is my toggle switch buttons are not working i.e. when I click on them nothing happens.
I really don't know what is the reason behind that all, but I tried to add one element manually i.e. without using Freemarker and suprisingly this manually added toggle switch worked FINE. But I still don't understand why are toggle switch buttons not working for elements added via Freemarker.
Here is my .FTL:
Here is CSS: