I am looking for some help on this one.

I have a form with 41 questions.  Each question has 6 radio boxes (only choose one).  
The name scheme looks like this

   <TD><FONT SIZE="1"><INPUT TYPE="RADIO" NAME="QUESTION1" VALUE="1"></FONT></TD>
   <TD><FONT SIZE="1"><INPUT TYPE="RADIO" NAME="QUESTION1" VALUE="2"></FONT></TD>
   <TD><FONT SIZE="1"><INPUT TYPE="RADIO" NAME="QUESTION1" VALUE="3"></FONT></TD>
   <TD><FONT SIZE="1"><INPUT TYPE="RADIO" NAME="QUESTION1" VALUE="4"></FONT></TD>
   <TD><FONT SIZE="1"><INPUT TYPE="RADIO" NAME="QUESTION1" VALUE="5"></FONT></TD>
   <TD><FONT SIZE="1"><INPUT TYPE="RADIO" NAME="QUESTION1" VALUE="6"></FONT></TD>

everything looks the same for each question(just change the name to question33 or 
whatever).  I have some JS to make sure they fill out atleast 1 box per question but 
its not working here is what I have.

function validate ()
{
 alert(document.evall.QUESTION1[1].checked);
 var tempitem;
 var optionselected;
 for (i=1 ; i < 7 ; i++) {
  optionselected = false;
  for (j=0 ; j < 6 ; j++) {
   tempitem = "document.evall.QUESTION" + i + "[" + j + "].checked"
   if (eval(tempitem) == false) {
               optionselected = true;
   }
     }
  if (optionselected == false){
   alert ("Please evaluate Question " + i + ".");
   return false;
  }
    }
 return false;
}

Anyone see what I am doing wrong, or have a better way to do it?

thanks

mike

______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to