function IsChecked()
{
var rblActive = document.getElementById("<%=rblActive.ClientID %>");
var item = rblActive.getElementsByTagName("input");
var IsItemChecked = false;
for (var i = 0; i < item.Length; i++)
{
if (item[i].checked)
{
IsItemChecked = true;
}
}
if (IsItemChecked == false)
{
alert("Check Yes or No");
rblActive.focus();
return false;
}
return true;
}
This is the code I tried. When control comes in the for loop, it directly comes out without any action even if the item in the radio button list is checked or not checked.
You can do the same with jQuery also..