Hi,
I am trying to validate RadioButtonList (ASP.NET) using the following js function but for some reason it does not working properly. I can't get the ID of the control as I would be..
Can you help please?
<asp:RadioButtonList ID="T_selector" runat="server">
<asp:ListItem Value="1">Team1</asp:ListItem>
<asp:ListItem Value="2">Team2</asp:ListItem>
</asp:RadioButtonList>
<script language="javascript" type="text/javascript">
function validate()
{
if (document.getElementById("T_selector").checked==false)
{
var answer = confirm ("Please confirm selection...")
if (answer)
return true;
else
return false;
}
return true;
}
</script>