IDEA: I have a form that must have a radio box checked in each pair (3 pairs) as yes or no. If neither is choosen, I must alert and return flase (or something) for user to make sure to check one. I want to do this dynamically (as possible) so I create an array of the names of the radio buttons and would like to eventually go through a loop to do the checking for each ".checked" state. By hard coding the positions to choose in the array I find a definate problem - the strings in the array are not acceptable as objects in the "document.forms[0].(radio name)[0].checked" statement. How do I get around this? Can I? Hard coding the whole thing is very bulky...
CODE: (note, this is just to get it working on a small scale)
function checkRadio(){
var radios= new Array("PC_Ready","PBX_Ready","CABLE_Ready"
;
/*(i=0, i<2, i++);*/
if (document.forms[0].radios[1][1].checked ==false ){
alert(radios[1]+" not checked"
}}
CODE: (note, this is just to get it working on a small scale)
function checkRadio(){
var radios= new Array("PC_Ready","PBX_Ready","CABLE_Ready"
/*(i=0, i<2, i++);*/
if (document.forms[0].radios[1][1].checked ==false ){
alert(radios[1]+" not checked"
}}