Hiding blank record data

J

james.shearer

I want to display the contents of a field with a label if there is data

in that field. If there isn't then I don't want the label to appear.

I tried this:

<%If Venueinfo("email") = "" Then
Else%>Email: <a href="mailto:<%=Venueinfo("email")%>">Click to
email</a><br><%End If%>

But it doesn't seem to work. It seems to always display the label and
link even though there is no data in that field.

help?

this is ASP and mysql
 
E

Evertjan.

wrote on 24 nov 2005 in microsoft.public.inetserver.asp.general:
<%If Venueinfo("email") = "" Then
Else%>Email: <a href="mailto:<%=Venueinfo("email")%>">Click to
email</a><br><%End If%>

vbScript code is new-line sensitive:

<%
If Venueinfo("email") <> "" Then
%>
Email: <a href='mailto:<%=Venueinfo("email")%>'>
Click to email</a><br>
<%
End If
%>

While jscript is not:

<% If (Venueinfo('email')!='') { %>Email:
<a href='mailto:<%=Venueinfo('email')%>'>
Click to email</a><br><% }; %>
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top