lundi 29 août 2016

checkbox onchange firing twice

I'm currently working on this page: http://ift.tt/2bwHfhZ I'm attaching an onchange event on checkboxes like this:

                    $("input[type='checkbox'][name='auswahl[]']").on("change", function () {
                        alert($(this).attr("id") + ' ' + $("label[for='" + $(this).attr("id") + "']").text() + $(this).attr("checked"));
                    });

The checkboxes look like this:

<input type="checkbox" name="auswahl[]" id="aus_nunatsiaqnews_ca"><label for="aus_nunatsiaqnews_ca" title="Canada">Nunatsiaq News</label>

Unfortunately the event is firing twice. When I isolate the code given above and put it on a test page everything is fine and the event is firing only once. Need help.




Aucun commentaire:

Enregistrer un commentaire