Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ouput query question

Posted on 2009-05-06
2
Medium Priority
?
232 Views
Last Modified: 2013-12-24
I have a shopping cart that is using an output query to display each line item.
I need to add some text to each line item if a varilable isdefined,
<cfif IsDefined("session.ccode")>
    <cfoutput><span class="text12red smallText">#GetCCode.Description#</span></cfoutput>
</cfif>
The problem is that it will repeat the output several times across the line. If I have one line item it will show once for that item.
If I have two line items it will show twice for the first one and once for the next.
If I have three lines items it will show three times for the first item, two times for the next and so on.
How do I get it to show only once for each line item?
0
Comment
Question by:usky1
2 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 1400 total points
ID: 24316288
It is difficult to say without seeing more code. My guess would be the <cfoutput> tags.  If you already using "using an output query" that means you already have cfoutput tags around the variable.  So you do not need a second set of <cfoutput> tags around the code above.   Try removing it ...

Example:
<cfoutput query="yourQuery">
    ...
     <cfif IsDefined("session.ccode")>
         <span class="text12red smallText">#GetCCode.Description#</span>
     </cfif>
    ...
</cfoutput>
0
 

Author Closing Comment

by:usky1
ID: 31578508
Some times the obvious is missed. thanks for catching that.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Screencast - Getting to Know the Pipeline
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question