Hello, I have a form with 18 questions, each has three possible answers, selectable by radio buttons.

Each question (group of 3 radio buttons) has a different name tag, i.e. question1, question2 etc..up to question 18.

I have been trying to manipulate a javascript in order that on submission, all 18 questions have been selected, otherwise the user shouldn't be forwarded to the next page: Its not quite working.
I know I need to iterate through the form elements (all radio buttons) and check them. Any tips, please (the code follows?

the Javascipt:

<script language="JavaScript">
function radio_validate(formObj) {
var isOK = false;
//iterate through form elements here in for loop
for (i=0;i<formObj.elements.length;i++) {
currElem = formObj.elements[i]
//if current radio button is checked, ok = true
if (currElem.type == "radio" && currElem.checked) {
if (!isOK) alert("Please answer all questions");

return isOK;
// --> </script>


A part of the HTML form:

<FORM name="theform" METHOD="POST" ACTION="http://........."
onSubmit="return radio_validate(this);">

<INPUT TYPE="radio" Name="question1" VALUE="1">
<INPUT TYPE="radio" Name="question1" VALUE="2">
<INPUT TYPE="radio" Name="question1" VALUE="3">

<INPUT TYPE="radio" Name="question2" VALUE="1">
<INPUT TYPE="radio" Name="question2" VALUE="2">
<INPUT TYPE="radio" Name="question2" VALUE="3">

<INPUT TYPE="radio" Name="question3" VALUE="1">
(etc....up to question18).

<INPUT TYPE="submit" Name="submit-a" Value ="Results">