How can you not know the name of the button? Even if the names are being generated dynamically, you can still pass that to a js function.
<!----------------//------ andy matthews web developer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --------------//---------> -----Original Message----- From: Steve Milburn [mailto:[EMAIL PROTECTED] Sent: Friday, October 21, 2005 11:35 AM To: CF-Talk Subject: RE: Form validation Thanks for the reply. This is exactly what I need, but I don't know how to do that since the name of my radio button group is not know beforehand. Does javascript have some sort of radio button collection that I could loop through, so every radio button group on the page gets checked, but I don't have to know it's name? I'll keep working on it. Thank again -----Original Message----- From: John Wilker [mailto:[EMAIL PROTECTED] Sent: Thursday, October 20, 2005 3:23 PM To: CF-Talk Subject: Re: Form validation you could write a javascript validation script. Something simple, just checking to see if the radiobuttongroup.checked == 'true' make your next button or whatever moves the user on to the next set of questions, check the validator script first. On 10/20/05, Steve Milburn <[EMAIL PROTECTED]> wrote: > > Hi folks > > > > I am having a problem validation a form. Users will be given 5 questions > on > the screen at a time, with 4 radio buttons for each question (A, B, C, D) > for a multiple choice style exam. I am dynamically naming the radio > buttons > so they correspond to the question ID. The code to output the radio > buttons is as follows: > > > > <cfinput type="radio" name="#session.exam[i][1]#" value="A" required="yes" > message="Please make sure you select an answer for every > question!"><strong>A</strong><br> > > <cfinput type="radio" name="#session.exam[i][1]#" value="B" required="yes" > message="Please make sure you select an answer for every > question!"><strong>B</strong><br> > > <cfinput type="radio" name="#session.exam[i][1]#" value="C" required="yes" > message="Please make sure you select an answer for every > question!"><strong>C</strong><br> > > <cfinput type="radio" name="#session.exam[i][1]#" value="D" required="yes" > message="Please make sure you select an answer for every > question!"><strong>D</strong><br> > > > > The #session.exam[i][1]# is an array that stores various information about > the exam. In this case, session.exam[i][1] is the question ID. However, > the > "required=yes" tag does not work when I dynamically name the radio > buttons. > If I give them a static name, it seems to work fine. Am I missing > something > here? Is there another way (javascript) that I can make sure each group of > radio buttons have a selection? > > > > By the way, I am using ColdFusion MX 7. > > > > Thanks in advance. > > Steve > > > > > --- > --- > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:221817 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54