Skip to main content
Known Participant
February 9, 2007
Question

CFFORM & CFOUTPUT

  • February 9, 2007
  • 1 reply
  • 320 views
Can you have a CFFORM insidie a CFOUTPUT tag? For EX.

<cfoutput query="info" group="Topic_Key">
<CFIF #Ability_Q# IS NOT " ">
<CFIF #URL.Q# GTE 1>
<CFFORM name="answer1" action="index.cfm?Topic_Key=1&Q=2">
<span class="questionsNormal">#Ability_Q[1]#</span><br />
<CFinput name="Yes" type="checkbox" />YES.<br />
<CFinput name="No" type="checkbox" />NO.
</cfform>
</CFIF>
</CFIF>
<br />
<CFIF #Ability_Q# IS NOT " ">
<CFIF #URL.Q# GTE 2>
<span class="questionsNormal">#Ability_Q[2]#</span>
</CFIF>
</CFIF>
</cfoutput>
This topic has been closed for replies.

1 reply

February 9, 2007
Yes you can. But be aware that your checkboxes have the same names: Yes and No. How are you planning to distinguish between them on your action page?

Also, you can simplify your code by combining your two CFIF tags:
<CFIF #Ability_Q# IS NOT " " AND #URL.Q# GTE 1>
Known Participant
February 9, 2007
ok I combined them but when I put in the the code
<CFFORM name="answer1" action="index.cfm?Topic_Key=1&Q=2">
<span class="questionsNormal">#Ability_Q[1]#</span><br />
<CFinput name="Yes" type="checkbox" />YES.<br />
<CFinput name="No" type="checkbox" />NO.
</cfform>

My page content disappears in preview, but when I remove it. It all reappears.