> i have a problem passing variables to an edit page, it passes the field
> pol_question fine but for the answer fields my loop is incorrect, it just
> reproduces the answers 5 times each. each answer is the
> ans_answer table is
> related to the pol_question through the pol_id, any help would be
> appreciated,
<cf_snip>
> <CFSET Ans1="">
> <CFSET Ans2="">
> <CFSET Ans3="">
> <CFSET Ans4="">
> <CFSET Ans5="">
>
> <!--- get first record --->
> <CFLOOP QUERY="GetAnswers">
> <CFSET Ans1=#ans_Ans#>
> <input type="hidden" name="ans_id1" value="#ans_id#">
> </CFLOOP>
>
> <!--- get second record etc the cfloop may not work as coded! --->
> <CFLOOP QUERY="GetAnswers">
> <CFSET Ans2=#ans_Ans#>
> <input type="hidden" name="ans_id2" value="#ans_id#">
> </CFLOOP>
>
> <CFLOOP QUERY="GetAnswers">
> <CFSET Ans3=#ans_Ans#>
> <input type="hidden" name="ans_id3" value="#ans_id#">
> </CFLOOP>
>
> <CFLOOP QUERY="GetAnswers">
> <CFSET Ans4=#ans_Ans#>
> <input type="hidden" name="ans_id4" value="#ans_id#">
> </CFLOOP>
>
> <CFLOOP QUERY="GetAnswers">
> <CFSET Ans5=#ans_Ans#>
> <input type="hidden" name="ans_id5" value="#ans_id#">
> </CFLOOP>

Erm, you've ASKED it to reproduce the answers multiple times

You should try something like this:
<CFLOOP QUERY="GetAnswers">
        <input type="hidden" name="ans_id#CurrentRow#" value="#ans_id#">
</CFLOOP>

That'll pass through as many "Ans_IDn" as you need, and not fix it to 5

HTH

Philip Arnold
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to