0
我有一個單選按鈕列表無法訪問單選按鈕列表的設定值
<asp:RadioButtonList CssClass="radioLable" ID="rbListPointsCat" runat="server" RepeatDirection="Horizontal"
AutoPostBack="true" OnSelectedIndexChanged="rbListPointsCat_SelectedIndexChanged">
<asp:ListItem runat="server" Value="Yes" />
<asp:ListItem runat="server" Value="No" />
</asp:RadioButtonList>
我使用以下JS功能
function CheckValue(sender, args) {
var rblist = document.getElementById('<% =rbListPointsCat.ClientID%>');
for (var x = 0; x < rblist.cells.length; x++) {
if (rblist.cells[x].checked) {
var Choice = (rblist.cells[x].innerText);
alert(Choice);
}
}
if (Choice=="No") {
if (txtRemarks.value == "") {
args.IsValid = false;
}
else {
args.IsValid = true;
}
}
else {
args.IsValid = true;
}
}
,但無法獲得檢查valur..it即將未定義。 請讓我知道我哪裏錯了?