开发者

Tick check box and enables submit button not working in IE6/7

I have the following code which is working开发者_如何学JAVA fine in firefox but ie just doesn't want to know:

$("#termsandconditionscontinue").attr("disabled", "disabled");

        $("#agreeTandC").click(function() {
            var checked_status = this.checked;
            if (checked_status == true) {
                $("#termsandconditionscontinue").removeAttr("disabled");
            }
            else {
                $("#termsandconditionscontinue").attr("disabled", "disabled");
            }
        });

Here is the example: http://jsfiddle.net/zidski/LXGMu/


The problem can lie in

var checked_status = this.checked;

Change it to:

var checked_status = $(this).attr("checked");

to make sure you use proper jQuery object which is cross browser compatible.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜