I use javascript to get the id of a radio button that is checked, it works fine except when there is only one radio button to choose, then it acts like there is non.
Heres my code to check
[CODE]
var frm = document.getElementById(‘frmRB’);
var send = document.getElementById(‘frmDel’);
for(var i=0;i < frm.rbSelected.length; i++)
{
if(frm.rbSelected[i].checked)
{
send.txtId.value = frm.rbSelected[i].value;
send.txtQId.value = <?=$qid?>;
send.txtType.value = ‘Delete’;
return true;
}
}
As i said, it return the corect value if there is more than one radio button, but when there is only one it doesn’t even go into the loop
Please help