开发者

checkbox checked or unchecked

functio开发者_JAVA技巧n Check_Clickd_li(objRef) {
    var btn1 = $find("<%= RadButton1.ClientID %>");
    var btn2 = $find("<%= RadButton2.ClientID %>");                
    if (objRef.checked = true) {
        btn1.set_enabled(true);
        btn2.set_enabled(true);
        alert("Enable");
    }
    else if (objRef.checked = false) {
        btn1.set_enabled(false);
        btn2.set_enabled(false);
        alert("Disable");
    }
}

What is the problem in this code? It always says "Enable".


You're doing an assignment. Use == for a comparison, or just:

if (objRef.checked) {
    // ...
}


You need to use == for comparison (or just test if(objRef.checked)).

Right now you set the value to true...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜