Ok, this situation is a little weird but anyway. This PHP code generates several radiobuttons:
for($i = 0; $i<count($questionList); $i++)
{
echo $questionList[$i]->__get(QuestionId).'-'.$questionList[$i]->__get(QuestionText).'<br />';
$answerList = $questionList[$i]->GetAnswers();
for($j = 0; $j<count($answerList); $j++)
{
echo '<br /><input type=\'radio\' name=\'group'.$i.'\' id=\'radioButtonAnswer'.$answerList[$j]->__get(AnswerId).'\' value=\''.$answerList[$j]->__get(AnswerId).'\' >'.
$answerList[$j]->__get(AnswerText).'</input>';
}
echo '<br /><br />';
}
Ok, that works fine, after the checkboxes are created, I'm trying to run some code to get all the radio buttons and it didn't work, so I tried just getting one radio button several times, and it only gets it the first time.
function Validate()
{
var i = 1;
do
{
document.writeln(document.getElementById('radioButtonAnswer2') == null);
i ++;
}while(i < 10);
document.writeln('out of loop');
return false;
}
So I know FOR SURE that 'radioButtonAnswer2' exists and it shouldn't be null. But this is what I get when I click the submit button:
false true true true true true true true true out of loop
The first time is not null, but after that, it is. Any thoughts?
Thanks!