FengShui1998
MIS
Hello,
I have multiple radio buttons, all named the same but with different values. I want to check and make sure at least one has been selected. This works for more than one radio button, but if there is only one radio button, it doesn't work.
Here is the code.
function getrdo()
{
var rdo = 'no';
for (var i=0; i < document.usrform.deviceid.length; i++)
{
if (document.usrform.deviceid.checked)
{
var devid = document.usrform.deviceid.value;
rdo = 'yes';
}
}
Any ideas?
I have multiple radio buttons, all named the same but with different values. I want to check and make sure at least one has been selected. This works for more than one radio button, but if there is only one radio button, it doesn't work.
Here is the code.
function getrdo()
{
var rdo = 'no';
for (var i=0; i < document.usrform.deviceid.length; i++)
{
if (document.usrform.deviceid.checked)
{
var devid = document.usrform.deviceid.value;
rdo = 'yes';
}
}
Any ideas?