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
...
精彩评论