Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Getting Started / July 2008



Tip: Looking for answers? Try searching our database.

Displaying an image & link if database has a value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
leemar99 - 02 Jul 2008 15:51 GMT
I need to display and image with a link if my ItemPDF cell has a valve, but
display nothing if there is no value, how do i go about doing this?

The value is likely to be "something.pdf"

Cheers,
Lee
jdeline - 02 Jul 2008 16:55 GMT
<CFIF Len(itemPDF) IS NOT 0>
<A HREF="something.pdf"><IMG SRC="myImage"></A>
</CFIF>
JR "Bob" Dobbs - 02 Jul 2008 16:59 GMT
I assume that your are using cfoutput to loop through the results of a query to
be displayed.  

Posting a more detailed question and any code you have already tried might
help us in answering your post.

See attached code.

<!--- assumes a cfquery object "myquery" and a column "link_value" that is
empty when there is no link to be displayed --->
<cfoutput query="myquery">
    <cfif myquery.link_value neq ""><a
href="#myquery.link_value#">#myquery.link_value#</a></cfif>
</cfoutput>
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.