Image Red X - How To Suppress?

E

Earl Partridge

FP 2000
I have a folder containing pictures of club members... but not all members.
My variable "photo" is created as:
photo = rs("LName") & "-" & rs("FName") & ".jpg"
Then the image is added to the table with:
<td BORDERCOLOR="#c0c0c0" valign="middle"><fong size="2" FACE="Arial"
COLOR="#000000">

<img src="images/mugshots/<%=photo%>"</td>

If there is no picture on file, a Red X is displayed. How can I suppress
that
Red X... or replace it with just a dash?
 
C

Chris Leeds, MVP-FrontPage

how about an if/then statement so that if the FName="" then photo=
dummyimage.jpg.

that way you could make a dummy image (like a silhouette or something) that
can be used if there's not a file in the table.

HTH

--
Chris Leeds,
Microsoft MVP-FrontPage

If you make web sites for other people, you should check out ContentSeed:
http://contentseed.com/
 
E

Earl Partridge

The variable "photo" will always contain a name. I read all names from a
database then create that variable. The problem is that I don't yet have a
picture of all members so when it tries to find an image file to match the
name in the "photo" variable, there is not one there. What I need is a
"if picture not found the" type statement.
Earl
 
T

Thomas A. Rowe

The easiest solution is to add Yes/No field, called "PhotoYN" to the database, set to True/False
with a default value of False, then check for all members that have a photo., then you code would
appear as follows:

<% If recordset("PhotoYN") = True Then %>
<img src="images/mugshots/<%=photo%>">
<% Else %>
&nbsp;
<% End If %>
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
W

Wally S

Another thing you could do is to make a photo of a dash. Then wherever you
have the name of a photo but not the photo, you could substitute a copy of
the dash photo and give it the same name and path as the photo that is
supposed to be there.

Wally S
 

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