mercredi 19 juin 2019

checkbox with custom image not working on IE

Sorry for bothering you with an IE-problem, but once again it's only IE making troubles.

I have a checkbox with a custom image. It works, it's clickable, it works on all browsers, except IE.

Here a screenshot: enter image description here

Here is the HTML of the checkbox, generated by Typo3 and the Powermail-Plugin. That means, that I can not alter the HTML-structure, as these fields are generated by Typo3/Powermail-Plugin.

     <label class="checked">
        <input type="hidden" name="tx_powermail_pi1[field][marker_20]" value="">
<input data-parsley-errors-container=".powermail_field_error_container_marker_20" 
    data-parsley-class-handler=".powermail_fieldwrap_marker_20 
    div:first > div" class="powermail_checkbox 
    powermail_checkbox_172" id="powermail_field_marker_20_1" 
    type="checkbox" name="tx_powermail_pi1[field][marker_20][]" 
    value="Ich habe die <f:link.page pageUid=&quot;45&quot; target=&quot;_blank&quot;>Datenschutzerklärung</f:link.page> verstanden."
 data-parsley-multiple="tx_powermail_pi1fieldmarker_20">
Ich habe die <a target="_blank" href="/datenschutz">Datenschutzerklärung</a> verstanden.
    </label>

And here the jQuery I use for toggling it:

$(".tx-powermail input[type=checkbox]:checked").parent("label").addClass("checked");
        $(".tx-powermail input[type=checkbox]").click(function() {
        $(this).parent("label").toggleClass("checked");
        });

It looks as if IE has problems with the hidden input field which is inserted by Typo3 I think. I have other checkboxes in other forms that lack that hidden input field so that the input type checkbox field is the labels first child element.

But I can't figure out how to fix this... can someone help?




Aucun commentaire:

Enregistrer un commentaire