lundi 31 octobre 2016

JQuery checkbox on Change not working in Safari

I am using the folowing code to select all or one-by-one select and saving checked checkboxes values into a object.

$(":checkbox.chbx-manage-select").on("change", function(e) {
            var st_lang_manag = {};

            $(":checkbox.chbx-manage-select").each(function(i,v) {
                st_lang_manag[v.value] = v.checked;
            });
          console.log(st_lang_manag);
        });

enter image description here

The code is working fine in Chrome and firefox but in safari 10.0.1 when I select all checkbox it saves false for all selected checkboxes in the object and when I unselect all checkbox it saves true for all unselected checkboxes in the object ( vice versa).

But when I select one by one it works fine.




Aucun commentaire:

Enregistrer un commentaire