Click to See Complete Forum and Search --> : How to hide empty data fields - ASP


rrobles
12-08-2003, 02:32 PM
Could anybody help me? I am doing a form to publish news. I have an upload field for images. Sometimes, I have images sometimes not. I want to hide the image field whenever it's empty.

I tried this code, but it doesn't work for me. Any time I do a search, it continues showing me the empty image field beside the text.

<% If Not IsNull ((Recordset1.Fields.Item("Image").Value)) Then %>

(Recordset1.Fields.Item("Image").Value)%

<% End if %>

Is there something wrong?

I will appreciate your help about this matter.

Thanks,

Randolph

GlennCarter
12-09-2003, 05:51 AM
I think I'd try something like this:

<%
If Recordset1.Fields.Item("Image").Value<>"" Then

Response.write("<img src=""" & Recordset1.Fields.Item("Image").Value & """>")

End if %>

I haven't been able to test it so try it out and get back to me if it doesn't work.

GC