that is because ALL your radio buttons have same NAME - "radio1" - thus
you have a group of 9 radio buttons.
you need to have a different NAME for each question.  you will also,
presumably, want a different VALUE for each of your radio button, too,
so depending on which one is selected you get its value in the form
scope. right now, based on your code, no matter which radio button is
selected, you will get "1a" as value.

try something like this:

<cfloop index="mainloop" from="1" to="3">
<cfoutput>This id Question#mainloop#</cfoutput>
<cfloop index='loop1' from="1" to="3"><br/>
<cfinput type="radio" name="radio#mainloop#" value="#loop1#"
required="yes" message="Please select the right option"></br>
</cfloop>
</cfloop>

with the above code you will have radio groups named "radio1", "radio2"
and "radio3", each with possible values "1", "2" or "3".

hth

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/



Priya Koya wrote:
> This is my Code:
> <cfform method="post">
>
> <cfloop index="mainloop" from="1" to="3">
> <cfoutput>This id Question#mainloop#</cfoutput>
> <cfloop index='loop1' from="1" to="3"><br/>
> <cfinput type="radio" name="radio1" value="1a" required="yes" message="Please 
> select the right option"></br>
> </cfloop>
> </cfloop>
> <cfinput type="Submit" name="Submit" value="Submit">
> </cfform>
>
> <cfif isDefined("form.Submit")>
> <cfoutput>#form.radio1#</cfoutput>
> </cfif>
>
> The output for this is 
> Question and 3 choose of radio button. I need to choose one option for each 
> of the question. but now I can choose only one option for all the questions 
> i.e one in 9 radio button. Can any one help with this????? 
>
> Thanks in Advance,
> Koya 
>   

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319063
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to