I am struggling with a radiobutton list
<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>
Here is the JavaScript function I am using
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;
}
}
However, I cannot seem to retrieve the checked value as it keeps showing up as undefined. Could someone please assist me in identifying where I may have made an error?