Ask a Question related to Macromedia ColdFusion, Design and Development.
-
prpldude #1
href help
I'm pretty new to CF still and I have created a cfm page that retreives a
specific record according to what was selected on the previous page. The record
in the database may or may not have information in some of the fields to
populatea "menu". The menu is just some buttons that bring up different
information about the record. pdf files or htm, cfm pages. If I use
"href='#variable#'" and there is no information for the variable from the
database, clicking on the menu button returns to the index page rather than
doing nothing.
In short, I want the button to not do anything if there is no information in
the record for the variable.
Here is a portion of the code:
<cfquery name="listing" datasource="listings">
SELECT LISTNUM, LRGIMAGE, LISTING, MAP, DEMOGRAPHICS, PICTURES, SITEPLANS,
BLDGPLANS, PARCEL
FROM LISTINGS
<cfif IsDefined("URL.ID")>
WHERE LISTNUM = #Val(URL.ID)#
</cfif>
</cfquery>
<cfoutput query="listing">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse:
collapse" bordercolor="##111111" width="600" id="AutoNumber2">
<tr>
<td width="14%">
<a target="_blank" href="#MAP#">
<img border="0" src="images/map.gif" width="85" height="23"></a></td>
<td width="14%">
<a target="_blank" href="#DEMOGRAPHICS#">
<img border="0" src="images/demographicssm.gif" width="85"
height="23"></a></td>
<td width="14%">
<a href="#PICTURES#">
<img border="0" src="images/pictures.gif" width="85"
height="23"></a></td>
<td width="14%">
<a href="#SITEPLANS#">
<img border="0" src="images/siteplan.gif" width="85"
height="23"></a></td>
<td width="14%">
<a href="#BLDGPLANS#">
<img border="0" src="images/buildingplan.gif" width="85"
height="23"></a></td>
<td width="15%">
<a target="_blank" href="#PARCEL#">
<img border="0" src="images/comments.gif" width="85"
height="23"></a></td>
<td width="15%">
<a target="_blank" href="#LISTING#">
<img border="0" src="images/print.gif" width="85" height="23"></a></td>
</tr>
</table>
</cfoutput>
I'm sure there is a simple solution I'm overlooking. I appreciate any help.
Thanks
prpldude Guest
-
Help with href problem
I try to make a link to see the upload file. The directory is correct but somehow it's unlinkable. Here is the code I have <cfoutput><cfif... -
cfformitem and HREF
Can you post the sample code for underlining links in a flash from. -
href links
My site has gone from 5 pages to 50 over this year. Every page has a sidebar, which includes the title, content and link to the other page on my... -
passing value via href
How do I write a hyperlink that also passes a value to the destination php page? Thanks in advance. ~Duane. -
href code
Hi How to write in c# href code so it looks in source Slide - pokaz programu - Remonty firmy Delta Software pls. look source of this link.... -
Ken Ford - *TMM* & PVII #2
Re: href help
Here's one way to do it:
<cfoutput query="listing">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="##111111" width="600"
id="AutoNumber2">
<tr>
<td width="14%">
<cfif listing.MAP NEQ "">
<a target="_blank" href="#MAP#"><img border="0" src="images/map.gif" width="85" height="23"></a>
<cfelse>
<img border="0" src="images/map.gif" width="85" height="23">
</cfif>
</td>
<td width="14%">
<cfif listing.DEMOGRAPHICS NEQ "">
<a target="_blank" href="#DEMOGRAPHICS#"><img border="0" src="images/demographicssm.gif" width="85" height="23"></a>
<cfelse>
<img border="0" src="images/demographicssm.gif" width="85" height="23">
</cfif>
</td>
<td width="14%">
<cfif listing.PICTURES NEQ "">
<a href="#PICTURES#"><img border="0" src="images/pictures.gif" width="85" height="23"></a>
<cfelse>
<img border="0" src="images/pictures.gif" width="85" height="23">
</cfif>
</td>
<td width="14%">
<cfif listing.SITEPLANS NEQ "">
<a href="#SITEPLANS#"><img border="0" src="images/siteplan.gif" width="85" height="23"></a>
<cfelse>
<img border="0" src="images/siteplan.gif" width="85" height="23">
</cfif>
</td>
<td width="14%">
<cfif listing.BLDGPLANS NEQ "">
<a href="#BLDGPLANS#"><img border="0" src="images/buildingplan.gif" width="85" height="23"></a>
<cfelse>
<img border="0" src="images/buildingplan.gif" width="85" height="23">
</cfif>
</td>
<td width="15%">
<cfif listing.PARCEL NEQ "">
<a target="_blank" href="#PARCEL#"><img border="0" src="images/comments.gif" width="85" height="23"></a>
<cfelse>
<img border="0" src="images/comments.gif" width="85" height="23">
</cfif>
</td>
<td width="15%">
<cfif listing.LISTING NEQ "">
<a target="_blank" href="#LISTING#"><img border="0" src="images/print.gif" width="85" height="23"></a>
<cfelse>
<img border="0" src="images/print.gif" width="85" height="23">
</cfif>
</td>
</tr>
</table>
</cfoutput>
--
Ken Ford
PVII Support Team
[url]http://www.projectseven.com[/url]
Team Macromedia Volunteer - Dreamweaver
Certified Dreamweaver MX 2004 Developer
"prpldude" <webforumsuser@macromedia.com> wrote in message news:d9jfu8$3c3$1@forums.macromedia.com...> I'm pretty new to CF still and I have created a cfm page that retreives a
> specific record according to what was selected on the previous page. The record
> in the database may or may not have information in some of the fields to
> populatea "menu". The menu is just some buttons that bring up different
> information about the record. pdf files or htm, cfm pages. If I use
> "href='#variable#'" and there is no information for the variable from the
> database, clicking on the menu button returns to the index page rather than
> doing nothing.
>
> In short, I want the button to not do anything if there is no information in
> the record for the variable.
> Here is a portion of the code:
>
> <cfquery name="listing" datasource="listings">
> SELECT LISTNUM, LRGIMAGE, LISTING, MAP, DEMOGRAPHICS, PICTURES, SITEPLANS,
> BLDGPLANS, PARCEL
> FROM LISTINGS
> <cfif IsDefined("URL.ID")>
> WHERE LISTNUM = #Val(URL.ID)#
> </cfif>
>
> </cfquery>
> <cfoutput query="listing">
> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse:
> collapse" bordercolor="##111111" width="600" id="AutoNumber2">
> <tr>
> <td width="14%">
> <a target="_blank" href="#MAP#">
> <img border="0" src="images/map.gif" width="85" height="23"></a></td>
> <td width="14%">
> <a target="_blank" href="#DEMOGRAPHICS#">
> <img border="0" src="images/demographicssm.gif" width="85"
> height="23"></a></td>
> <td width="14%">
> <a href="#PICTURES#">
> <img border="0" src="images/pictures.gif" width="85"
> height="23"></a></td>
> <td width="14%">
> <a href="#SITEPLANS#">
> <img border="0" src="images/siteplan.gif" width="85"
> height="23"></a></td>
> <td width="14%">
> <a href="#BLDGPLANS#">
> <img border="0" src="images/buildingplan.gif" width="85"
> height="23"></a></td>
> <td width="15%">
> <a target="_blank" href="#PARCEL#">
> <img border="0" src="images/comments.gif" width="85"
> height="23"></a></td>
> <td width="15%">
> <a target="_blank" href="#LISTING#">
> <img border="0" src="images/print.gif" width="85" height="23"></a></td>
> </tr>
> </table>
> </cfoutput>
>
> I'm sure there is a simple solution I'm overlooking. I appreciate any help.
> Thanks
>
Ken Ford - *TMM* & PVII Guest
-
prpldude #3
Re: href help
Thanks Ken that worked great. I appreciate your quick response and help.
prpldude Guest



Reply With Quote

