Hi all,
I have a question regarding how to display the checked value of a radio button to the next page (and CFMAIL). The following code is generated and displays a series of questions pulled form a DB.
<tr valign="top">
<td><font class="body">Questions</font></td>
<td nowrap>
<center>
<font class="smallcopy">Not<br>
Relevant </font>
</center>
</td>
<td nowrap>
<center>
<font class="smallcopy">Strongly<br>
Disagree </font>
</center>
</td>
<td nowrap></td>
<td nowrap>
<center>
<font class="smallcopy">Strongly<br>
Agree </font>
</center>
</td>
</tr>
<cfloop Query="questions">
<cfoutput>
<tr valign="top">
<td>
<div align="right"><font class="body">#question_text#</font></div>
</td>
<td nowrap>
<center>
<font class="body">
<cfinput type="radio" name="#question_id#" value="N">
</font>
</center>
</td>
<td nowrap>
<center>
<cfinput type="radio" name="#question_id#" value="1">
<cfinput type="radio" name="#question_id#" value="2">
</center>
</td>
<td nowrap>
<center>
<cfinput type="radio" name="#question_id#" value="3" checked>
</center>
</td>
<td nowrap>
<center>
<cfinput type="radio" name="#question_id#" value="4">
<cfinput type="radio" name="#question_id#" value="5">
</center>
</td>
</tr>
</cfoutput>
</cfloop>
So for example the page would look like this : (each question's radio buttons have a value(1 to 5) and a name(#question_id#)
Question 1 goes here Radio1 Radio2 Radio3 Radio4 Radio5
Question 2 goes here Radio1 Radio2 Radio3 Radio4 Radio5
Question 3 goes here Radio1 Radio2 Radio3 Radio4 Radio5
Question 4 goes here Radio1 Radio2 Radio3 Radio4 Radio5
When i hit 'submit' validation is run (for other stuff), and I want to get the results of each question, like this:
Question 1 : The rating given was (5)
Question 2 : The rating given was (3)
Question 3 : The rating given was (1)
Question 4 : The rating given was (2)
How do I get the results of the checked radio buttons? Do I have to use a List? If someone has similar examples I would really appreciate them showing me how they would do such a task.
Regards, [sig]<p>Matthew Wall<br><a href=mailto: > </a><br><a href= > </a><br> [/sig]
I have a question regarding how to display the checked value of a radio button to the next page (and CFMAIL). The following code is generated and displays a series of questions pulled form a DB.
<tr valign="top">
<td><font class="body">Questions</font></td>
<td nowrap>
<center>
<font class="smallcopy">Not<br>
Relevant </font>
</center>
</td>
<td nowrap>
<center>
<font class="smallcopy">Strongly<br>
Disagree </font>
</center>
</td>
<td nowrap></td>
<td nowrap>
<center>
<font class="smallcopy">Strongly<br>
Agree </font>
</center>
</td>
</tr>
<cfloop Query="questions">
<cfoutput>
<tr valign="top">
<td>
<div align="right"><font class="body">#question_text#</font></div>
</td>
<td nowrap>
<center>
<font class="body">
<cfinput type="radio" name="#question_id#" value="N">
</font>
</center>
</td>
<td nowrap>
<center>
<cfinput type="radio" name="#question_id#" value="1">
<cfinput type="radio" name="#question_id#" value="2">
</center>
</td>
<td nowrap>
<center>
<cfinput type="radio" name="#question_id#" value="3" checked>
</center>
</td>
<td nowrap>
<center>
<cfinput type="radio" name="#question_id#" value="4">
<cfinput type="radio" name="#question_id#" value="5">
</center>
</td>
</tr>
</cfoutput>
</cfloop>
So for example the page would look like this : (each question's radio buttons have a value(1 to 5) and a name(#question_id#)
Question 1 goes here Radio1 Radio2 Radio3 Radio4 Radio5
Question 2 goes here Radio1 Radio2 Radio3 Radio4 Radio5
Question 3 goes here Radio1 Radio2 Radio3 Radio4 Radio5
Question 4 goes here Radio1 Radio2 Radio3 Radio4 Radio5
When i hit 'submit' validation is run (for other stuff), and I want to get the results of each question, like this:
Question 1 : The rating given was (5)
Question 2 : The rating given was (3)
Question 3 : The rating given was (1)
Question 4 : The rating given was (2)
How do I get the results of the checked radio buttons? Do I have to use a List? If someone has similar examples I would really appreciate them showing me how they would do such a task.
Regards, [sig]<p>Matthew Wall<br><a href=mailto: > </a><br><a href= > </a><br> [/sig]