"janey smith" <[EMAIL PROTECTED]>

> 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.

Try consolidating your code, combining the hidden vars and the input fields into a 
single 
loop. You were getting 5 answers for each loop because loops do what they are supposed 
to 
do: they loop through an entire query set. I didn't take the time to fully decipher 
the page you're trying to build, but you ought to be able to build it with only 
one or two loops and a few lines of code. Something along these lines:

<CFLOOP QUERY="GetAnswers">
        <input type="hidden" name="ans_id#GetAnswers.CurrentRow#" 
value="#GetAnswers.ans_id#">
        <p>Answer #GetAnswers.CurrentRow#:
        <input type="text" name="answer#GetAnswers.CurrentRow#" size="45" 
value="#GetAnswers.ans_Ans#">
</CFLOOP>

Gene Kraybill
LPW & Associates
Mansfield, PA
------------------------------------------------------------------------------
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