我想從js啓用我的checkboxlist?這是我的代碼SOFAR:如何從javascript啓用asp.net checkboxlist?
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<script>
function enabledCBL() {
document.getelementbyid('CheckBoxList1').disabled = false;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<button onclick="enabledCBL()">enable</button>
<asp:CheckBoxList ID="CheckBoxList1" runat="server" TextAlign="Right">
<asp:ListItem Text="een">
</asp:ListItem>
<asp:ListItem Text="twee">
</asp:ListItem>
<asp:ListItem Text="drie">
</asp:ListItem>
<asp:ListItem Text="vier">
</asp:ListItem>
</asp:CheckBoxList>
</div>
</form>
</body>
</html>
檢查CheckBoxList的真實身份你的HTML輸出 – hungneox 2011-12-14 04:43:35
你的腳本有問題。 – 2011-12-14 07:19:14