I am having trouble checking the hidden checkboxes in IE. This base is html:
& lt; Input id = "groups_ids_1" name = "group_ids []" type = "checkbox" value = "1" /> & Lt; Label = "groups_ids_1" & gt; Display & lt; / Label & gt;
It works fine, but if I want to hide checkbones then using
$ ('input [type = checkbox]') . Hide ();
or
$ ('Input [type = checkbox]'). CSS ('visibility', 'hidden'); Clicking on the label will no longer check the checkboxes in IE, of course it works fine in Firefox, Chrome and Safari.
You can add an onclick to the label to learn about IE issues.
$ ('label'). Click (function () {$ ('#' + $ (this) .attr ('for')). ();});
If that does not work, try setting the attribute manually.
$ ('label'). Click (function () {var checkbox = $ ('#' + $ (this) .attr ('for')); if (checkbox. ((': Check')) {checkbox.removeAttr ('checked') ;} Else {checkbox.attr ('checked', 'check');}});
Comments
Post a Comment