A
amerar
Hi All,
I am using this code to dynamically check is a radio button was checked
on the page. This worked great, if there is more then 1 button in the
group, but fails if there is only 1 button in the group......
Can anyone help debug? I'm stumped.....
function valButton(btn) {;
var cnt = -1;;
for (var i=btn.length-1; i > -1; i--) {;
if (btn.checked) {cnt = i; i = -1;};
};
if (cnt > -1) {return btn[cnt].value;};
else {return null;};
};
Thanks,
I am using this code to dynamically check is a radio button was checked
on the page. This worked great, if there is more then 1 button in the
group, but fails if there is only 1 button in the group......
Can anyone help debug? I'm stumped.....
function valButton(btn) {;
var cnt = -1;;
for (var i=btn.length-1; i > -1; i--) {;
if (btn.checked) {cnt = i; i = -1;};
};
if (cnt > -1) {return btn[cnt].value;};
else {return null;};
};
Thanks,