开发者

jQuery checkbox selection is not working in IE and is working in Firefox

开发者 https://www.devze.com 2023-01-02 11:22 出处:网络
This is my selectall button code..on clicking this i am selecting all checkboxes.. $(\'#PbtnSelectAll\').click(function() {

This is my selectall button code..on clicking this i am selecting all checkboxes..

   $('#PbtnSelectAll').click(function() {
        $('#PricingEditExceptions input[type=checkbox]').attr('checked', 'checked');
            $('#PbtnSubmit').show();
            $('#PbtnCancel').show();
            $('fieldset').find("input:not(:checkbox),select,textarea").attr('disabled',true);
            $('#genericfieldset').find("input,select,textarea").removeAttr('disabled');
        });

This code working in Firefox not in IE. Why it's doi开发者_高级运维ng like this?


Check the id's of all your elements. I'd be using .PbtnSelectAll etc and giving each element a class of the same. At least the class doesn't change like the name can.


try using "#Fieldset input:checkbox" as your selector.


Try using a boolean instead

$('#Fieldset input[type=checkbox]').attr('checked',true);


Try to use true , false boolean. Can you try http://www.iknowkungfoo.com/blog/index.cfm/2008/7/9/Check-All-Checkboxes-with-JQuery ?

it's working in my IE 7.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号