ya it is sorry, I was playing with it.  My real code has it as true...

>>> [EMAIL PROTECTED] 04/24/02 11:27AM >>>
shouldn't this line be:

if (eval(tempitem) == true)

----- Original Message -----
From: "Michael Ross" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, April 24, 2002 10:10 AM
Subject: JS Help


> 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
>
> 

______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to