I have a for loop seen below....
var the_form = document.getElementById(formName);
for(var i=0; i<the_form.length; i++)
{
var temp = the_form.elements[i].type;
if (temp == "radio")
{
for (x = 0; x < the_form.elements[i].length - 1; x++)
{
//do stuff
}
}
}
Right before the inside loop I do the following and next to its the
results, any idea why the last one returns 0?
alert(the_form.elements[i].id); // returns question1
alert(the_form.question1.length); // returns 4 (amount of radio
buttons in that group)
alert(the_form.elements[i].length); // returns 0
I cannot figure out why this is the case. Am I blatantly looking over
something?