Can I use javascript to dynamically create an html form?
For example, I want to use a for loop to cycle 5 times and create a form with 5 separate sets of radio boxes, and have the javascript create the name for each set of radio boxes.
I can't get it to work though.
I am using this:
document.write('<INPUT TYPE=RADIO NAME="question"' + (questionIndex + 1) + 'VALUE="b">' + optionB);
where questionIndex and optionB are variables.
I wanted the name of the radio boxes to be question1, question2, etc.
Thanks.
For example, I want to use a for loop to cycle 5 times and create a form with 5 separate sets of radio boxes, and have the javascript create the name for each set of radio boxes.
I can't get it to work though.
I am using this:
document.write('<INPUT TYPE=RADIO NAME="question"' + (questionIndex + 1) + 'VALUE="b">' + optionB);
where questionIndex and optionB are variables.
I wanted the name of the radio boxes to be question1, question2, etc.
Thanks.