Forums

This topic is locked

If Hyperlink is Null

Posted 30 Sep 2002 11:49:40
1
has voted
30 Sep 2002 11:49:40 Dave Thomas posted:
Hi,

On a list of clan teams, linked to a DB field containing their url's is it possible to:

Write the team out as plain text if the hyperlink is null instead of getting a href value of "/" in the browser.

Regards,
Dave

UD4 || Flash || Access ||Web Hosting

Replies

Replied 30 Sep 2002 12:44:51
30 Sep 2002 12:44:51 Vince Baker replied:

<% If rsRecordset1.fields.item("URLFieldName".value = "" or Null Then%>

<%=rsRecordset1.fields.item("TextfieldtoDisplay".value%>

<% Else %>

<a href="<%=rsRecordset1.fields.item("URLFieldName".value"><%=rsRecordset1.fields.item("TextfieldtoDisplay".value%></a>

<% End If %>

Regards
Vince

Response.write("The best line of code you can ever use"

VBScript | ASP | HTML | SQL | Oracle | Hosting

Edited by - bakerv on 30 Sep 2002 12:45:46
Replied 30 Sep 2002 13:22:25
30 Sep 2002 13:22:25 Dave Thomas replied:
i thought of something along them lines,

thanks again vince.

Regards,
Dave

UD4 || Flash || Access ||Web Hosting
Replied 01 Oct 2002 17:48:22
01 Oct 2002 17:48:22 Dave Thomas replied:
Okies that didn't work but thanks for trying anyway. I appreciate it;

Heres the working code below:

<% Dim strTeam, strLink, strFinal

strTeam = rsClanA.fields.Item("Opponent"
strLink = rsClanA.fields.Item("ClanURL"

if len(strLink)>0 then
strFinal = "<a href="""&strLink&""">"&strTeam&"</a>"
else
strfinal = strTeam
end if
response.write strFinal
%>

Regards,
Dave

UD4 || Flash || Access ||Web Hosting

Reply to this topic