I am trying to get the value from a series of radio buttons, and my method worked for the first set of 3, but when I repeated the procedure for the 2nd set of 3 radio buttons it didn’t work because of the “.length”
Working Code:
for (var x=0; x<Form.A111_answer.length; x++)
{
if (Form.A111_answer[x].checked)
{
var A111_response=Form.A111_answer[x].value;
}
}
Not-Working Code (immediately follows the previous code):
for (var x=0; x<Form.A122_answer.length; x++)
{
if (Form.A122_answer[x].checked)
{
var A122_response=Form.A122_answer[x].value;
}
}
This is the error I get:
Error: Number:-2146823281 Description:‘A122_answer.length’ is null or not an object
Any insight about the problem is much appreciated.