DRW: null values in hyperlink fields

J

John Garvey

I am trying to stop what appears to be a leading underscore with a hyperlink
to my home page from appearing on the .asp page when the hyperlink field is
null. You can see an example here.


Does anyone know how to avoid this?

In my db I have a URL field which holds the URL to
 
J

John Garvey

Sorry, please disregard this post. I didn't realize I accidentally posted
before completing, and so followed up with a subsequent post. Apologies for
clogging up the newsgroup!
 
J

John Garvey

Ugh! When I re-posted this it went in the Access Database forums, and I
think this is probably more of a FrontPage question. Sleep deprivation takes
its toll..... Anyway, in case anyone is looking at this and hasn't written
me off as an idiot, here's the complete thought that I meant to post the
first time:

I am trying to figure out how to eliminate an underscore with a hyperlink to
my home page from appearing on .asp pages when the value is null. Here's an
example. Look for the underscores on the left side of the body of the page
(white section).

http://www.sharingweb.org/orgdetail.asp?OrgName=St.+Bridget's+Church+-+Abington

In the database I have a URL field and an email field, but these are often
not populated. When the field is blank like that, I get these underscores
with the links. I'd be grateful for any suggestions. I'm using the database
results wizard in FrontPage 2003.
 
K

Kathleen Anderson

From:
http://www.spiderwebwoman.com/resources/dbrwtipsandtricks.asp#hyperlinks

If you have some records where the URL field is empty, you will see a line
in the Database Results when you preview the page. If you want to get rid of
it, find in your code where the URL field gets displayed, and change it to
this:

<% If fp_rs("URL")> " " then %><a href="<%=FP_FieldLink(fp_rs,"URL")%>"><%
End If %>
--

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

John Garvey

This is working perfectly for displaying values from fields that contain
hyperlinks and email addresses. I'm tripping up on how to, or even whether I
can, use the same technique on a (non-html) database column value to which I
have assigned a hyperlink and parameters for opening related pages. Any
suggestions there? Here's the code I'd like to fix to remove the leading
space:

<a
href="locdetail.asp?OrgName=<%=FP_FieldURL(fp_rs,"OrgName")%>&LocName=<%=FP_FieldURL(fp_rs,"LocName")%>">

<!--webbot bot="DatabaseResultColumn"
s-columnnames="OrgName,LocName,OrgDescription,LocMainOffice?,LocAddress1,LocAddress2,LocCityActual,City,LocState,LocZip,Phone,Extension,Hotline,Fax,TTY,Email,LocURL,LocDescription"
s-column="LocName" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE"
clientside b-MenuFormat preview="<font size="-1">&lt;&lt;</font>LocName<font
size="-1">&gt;&gt;</font>" startspan
s-ColumnTypes="202,202,203,11,202,202,202,202,202,202,202,202,202,202,202,202,203,203"
--><%=FP_FieldVal(fp_rs,"LocName")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="13854" --></a>
 
K

Kathleen Anderson

Wrap it in a script that checks to see if there's anything in the field -
this might work:

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

<a
href="locdetail.asp?OrgName=<%=FP_FieldURL(fp_rs,"OrgName")%>&LocName=<%=FP_FieldURL(fp_rs,"LocName")%>">

<!--webbot bot="DatabaseResultColumn"
s-columnnames="OrgName,LocName,OrgDescription,LocMainOffice?,LocAddress1,LocAddress2,LocCityActual,City,LocState,LocZip,Phone,Extension,Hotline,Fax,TTY,Email,LocURL,LocDescription"
s-column="LocName" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE"
clientside b-MenuFormat preview="<font size="-1">&lt;&lt;</font>LocName<font
size="-1">&gt;&gt;</font>" startspan
s-ColumnTypes="202,202,203,11,202,202,202,202,202,202,202,202,202,202,202,202,203,203"
--><%=FP_FieldVal(fp_rs,"LocName")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="13854" --></a>


<% End If %>


--

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



John Garvey said:
This is working perfectly for displaying values from fields that contain
hyperlinks and email addresses. I'm tripping up on how to, or even
whether I
can, use the same technique on a (non-html) database column value to which
I
have assigned a hyperlink and parameters for opening related pages. Any
suggestions there? Here's the code I'd like to fix to remove the leading
space:

<a
href="locdetail.asp?OrgName=<%=FP_FieldURL(fp_rs,"OrgName")%>&LocName=<%=FP_FieldURL(fp_rs,"LocName")%>">

<!--webbot bot="DatabaseResultColumn"
s-columnnames="OrgName,LocName,OrgDescription,LocMainOffice?,LocAddress1,LocAddress2,LocCityActual,City,LocState,LocZip,Phone,Extension,Hotline,Fax,TTY,Email,LocURL,LocDescription"
s-column="LocName" b-tableformat="TRUE" b-hashtml="FALSE"
b-makelink="FALSE"
clientside b-MenuFormat preview="<font
size="-1">&lt;&lt;</font>LocName<font
size="-1">&gt;&gt;</font>" startspan
s-ColumnTypes="202,202,203,11,202,202,202,202,202,202,202,202,202,202,202,202,203,203"
--><%=FP_FieldVal(fp_rs,"LocName")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="13854" --></a>
 
J

John Garvey

I see how that works, and it does the trick. My page is beautiful now.
Thank you again!

John Garvey
 

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