I am wanting to deteremine which radio button is selected on a form and
am using:
//alert(document. CC.Ecom_Payment _Card_Type.leng th)
for (var i=0;i<document. CC.Ecom_Payment _Card_Type.leng th;i++) {
if (document.CC.Ec om_Payment_Card _Type[i].checked) {
var CardType =
document.CC.Eco m_Payment_Card_ Type[i].value
}
}
This works fine if there are 2 or more radio buttons, but if there is
only one, it fails. The alert if I uncomment it says that the length is
undefined, when it should be 1. Anyone know what the problem is and how
I can get around it?
Marshall
am using:
//alert(document. CC.Ecom_Payment _Card_Type.leng th)
for (var i=0;i<document. CC.Ecom_Payment _Card_Type.leng th;i++) {
if (document.CC.Ec om_Payment_Card _Type[i].checked) {
var CardType =
document.CC.Eco m_Payment_Card_ Type[i].value
}
}
This works fine if there are 2 or more radio buttons, but if there is
only one, it fails. The alert if I uncomment it says that the length is
undefined, when it should be 1. Anyone know what the problem is and how
I can get around it?
Marshall
Comment