我写了一个简单的函数:
function updatePhase6Visibility(checkbox) {
//alert("working");
if (checkbox.checked) {
Phase6.show();
}
else {
Phase6.hide();
}
}
该复选框以HTML格式显示:
<input id="mycheck6" name="mycheck" type="checkbox" data-dojo-type="dijit/form/CheckBox" value="agreed" checked onclick="updatePhase6Visibility(this);" /> <label for="mycheck6">Phase 6</label>
检查初始状态 - 如何将其更改为未选中状态?
答案 0 :(得分:1)
删除“已检查”
Original:
<input id="mycheck6" name="mycheck" type="checkbox" data-dojo-type="dijit/form/CheckBox" value="agreed" checked onclick="updatePhase6Visibility(this);" /> <label for="mycheck6">Phase 6</label>
Updated:
<input id="mycheck6" name="mycheck" type="checkbox" data-dojo-type="dijit/form/CheckBox" value="agreed" onclick="updatePhase6Visibility(this);" /> <label for="mycheck6">Phase 6</label>