IF in Hyperlink

J

John P.

I have a Data Results table and some records have a field with a pdf
document hyperlinked, but not all.records have one.

Is there a way where on the hyperlink I can say show PDF link only if the
field is populated?

As at resent I have people clicking on the links (empty ones) and getting
nothing.

Thanks
John P.
 
K

Kathleen Anderson

You could wrap the code in a script that tests whether or not there is
anything in that field:

here's an example:


<% If fp_rs("Municipality") > " " then %>


<li><b>Municipality:</b> ­<!--webbot bot="DatabaseResultColumn"
startspan


s-columnnames="ProgramArea,Rec­ordNum,Date,ItemNumber,SplitIt­em,Session,PA­_SA
,ActNumber,Section,Recipient,M­unicipality,FundsUse,DollarFie­ld1,DollarFie­ld2
,DollarField3,DollarField4,Any­_Previous,DollarField5,FundNum­,AgencyNum,SI­D,P
roject_Num,Description"
s-column="Municipality" b-tableformat="FALSE" b-hashtml="FALSE"
clientside
preview="<font
size="-1">&lt­;&lt;</font>Municipa­lity<font
size="-1">&gt­;&gt;</font>" b-makelink
b-MenuFormat --><%=FP_FieldVal(fp_rs,"Munic­ipality")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="33247" --></li>


<% End If %>




--

~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
Expression Web Resources: http://www.spiderwebwoman.com/xweb/
Expression Web Wiki: http://expression-web-wiki.com/
FrontPage Resources: http://www.spiderwebwoman.com/resources/
Please reply to the newsgroup for the benefit of others
 
S

Stefan B Rusynko

PS
- the test you posted only checks if the field is greater than a space " "
<% If fp_rs("Municipality") > " " then %>

Better to use a test for an empty record as

<% If fp_rs("Municipality")<> "" Then %>

Or

<% If Len(fp_rs("Municipality")>0 Then %>




--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| You could wrap the code in a script that tests whether or not there is
| anything in that field:
|
| here's an example:
|
|
| <% If fp_rs("Municipality") > " " then %>
|
|
| <li><b>Municipality:</b> ­<!--webbot bot="DatabaseResultColumn"
| startspan
|
|
| s-columnnames="ProgramArea,Rec­ordNum,Date,ItemNumber,SplitIt­em,Session,PA­_SA
| ,ActNumber,Section,Recipient,M­unicipality,FundsUse,DollarFie­ld1,DollarFie­ld2
| ,DollarField3,DollarField4,Any­_Previous,DollarField5,FundNum­,AgencyNum,SI­D,P
| roject_Num,Description"
| s-column="Municipality" b-tableformat="FALSE" b-hashtml="FALSE"
| clientside
| preview="<font
| size="-1">&lt­;&lt;</font>Municipa­lity<font
| size="-1">&gt­;&gt;</font>" b-makelink
| b-MenuFormat --><%=FP_FieldVal(fp_rs,"Munic­ipality")%><!--webbot
| bot="DatabaseResultColumn" endspan i-checksum="33247" --></li>
|
|
| <% End If %>
|
|
|
|
| --
|
| ~ Kathleen Anderson
| Microsoft MVP - FrontPage
| Spider Web Woman Designs
| Expression Web Resources: http://www.spiderwebwoman.com/xweb/
| Expression Web Wiki: http://expression-web-wiki.com/
| FrontPage Resources: http://www.spiderwebwoman.com/resources/
| Please reply to the newsgroup for the benefit of others
|
|
| | >I have a Data Results table and some records have a field with a pdf
| >document hyperlinked, but not all.records have one.
| >
| > Is there a way where on the hyperlink I can say show PDF link only if the
| > field is populated?
| >
| > As at resent I have people clicking on the links (empty ones) and getting
| > nothing.
| >
| > Thanks
| > John P.
| >
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top