This code will prompt the user with four different questions and store them in an array for later processing. Don't know how this will interact with your loop (it may prevent your needing it). If this doesn't give you an idea about how you can use JavaScript to solve your problem, you might post a little more info about what you're trying to accomplish. I didn't take the time to insure that this is cross-browser-capable, but hopefully it's a start for you.
Good luck.
<html>
<body onload="getData()">
<script language="javaScript">
var Questions = new Array("Question 1", "Question 2",
"Question 3", "Question 4"

;
var NextQuestion=0;
var Responses = new Array();
var ResponseCount=0;
var IntervalID;
function getData()
{
//populate the text box with the first question
//this could be left out if you want to initialize the value
//with simple HTML
document.getElementById('prompt').innerHTML = Questions[NextQuestion];
IntervalID = setInterval('checkData()', 500);
}
function checkData()
{
var cBoxes = document.forms['myForm'].elements['input'];
for (var i=0; i < cBoxes.length; i++)
{
if (cBoxes
.checked == true)
{
//store the response
Responses[ResponseCount] = cBoxes.value;
ResponseCount++;
//reset the button
cBoxes.checked = false;
//show the next question
if (NextQuestion+1 < Questions.length)
{
NextQuestion++;
document.getElementById('prompt').innerHTML = Questions[NextQuestion];
}
else
{
document.getElementById('prompt').innerHTML = "No more questions";
//stop listening
clearInterval(IntervalID);
alert(Responses);
}
}
}
}
</script>
<form method="POST" name="myForm">
<table border="1" width="100%">
<tr>
<td width="100%" id="prompt"> </td>
</tr>
<tr>
<td width="100%" > <input type="radio" value="1" name="input">
Selection 1 <input type="radio" name="input" value="2">
Selection 2</td>
</tr>
</table>
</form>
</body>
</html>