IBM developerWorks
           ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old March 7th, 2005, 08:19 PM
jpixel jpixel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 47 jpixel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 50 m 41 sec
Reputation Power: 4
small cfif problem

<!--- output contents of the query--->

<cfoutput query="getids">
<tr>
<td>#id#</td>
<td>#makeID#</td>
<td>#modelID#</td>
<td>#AuctionReserve#</td>
<td>#bidCount#</td><cfif val(#highestBid#) gt val(#AuctionReserve#)>
<td><font color="##FFFFFF">#highestBid#</font><cfelse>#highestBid#</td></cfif>
</tr>
</cfoutput>

above u can see a simple query output into a table.
my problem is with cfif, basically if the highestBid is bigger than the reserve price (AuctionReserve) then I want the price (highestbid) in red. For some reason the results disappear in that column...

Reply With Quote
  #2  
Old March 7th, 2005, 08:31 PM
fortunato fortunato is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 33 fortunato User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 36 m 52 sec
Reputation Power: 4
basically cause FFFFFF is white, but also make sure to match your open/close all your tags or things will disappear as well. Indented format makes everything easier to see. Match your font open close tags, match your td open close tags.

Code:
<td>
<cfif val(#highestBid#) gt val(#AuctionReserve#)>
<font color="red">#highestBid#</font>
<cfelse>
#highestBid#
</cfif> </td>

Reply With Quote
  #3  
Old March 9th, 2005, 12:19 PM
spyordie007 spyordie007 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 7 spyordie007 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 4 sec
Reputation Power: 0
Or you could specify the color in the cfelse & shorten your code up quite a bit:
Code:
<td><font <cfif val(#highestBid#) gt val(#AuctionReserve#)>color="red"<cfelse>color="black"</cfif>>#highestBid#</font></td>

It'll work either way, I (personally) just like to keep things like this simple.

Reply With Quote
  #4  
Old March 9th, 2005, 01:19 PM
Bastion Bastion is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 181 Bastion User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 4 h 23 m 47 sec
Reputation Power: 4
Quote:
Originally Posted by jpixel
<cfif val(#highestBid#) gt val(#AuctionReserve#)>
<td><font color="##FFFFFF">#highestBid#</font>
<cfelse>
#highestBid#</td>
</cfif>



Really watch how your are running your if statement. Right now, it's set up that when the highest bid is greater than the auction reserver, you are starting a table cell but not ending it. But when the the if statement is not reached, the else part doesn't start a cell but ends the cell. Regardless of the color you are looking for and based on what you are writing it should go as:

<cfif val(#highestBid#) gt val(#AuctionReserve#)>
<td><font color="##FFFFFF">#highestBid#</font></td>
<cfelse>
<td>#highestBid#</td>
</cfif>

OR
<td>
<cfif val(#highestBid#) gt val(#AuctionReserve#)>
<font color="##FFFFFF">#highestBid#</font>
<cfelse>
#highestBid#
</cfif>
</td>

Reply With Quote
  #5  
Old March 9th, 2005, 05:13 PM
jpixel jpixel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 47 jpixel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 50 m 41 sec
Reputation Power: 4
amazing replies guys, thank you so much!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > small cfif problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway