Forums

ASP

This topic is locked

::: how do you hide a blank field:::

Posted 18 Sep 2002 16:41:08
1
has voted
18 Sep 2002 16:41:08 Johnny morris posted:
Can anyone tell me how to hide an empty field in a record set but show it when it has a value?? ie i have a database where some records have a second image stored and some do not, but i want to be able to repeat a region of 6 items, but auto hide any given item when it is an empty field in the database,
I know it is a simple snippet but i cant find it??
Can anyone help??

Many Thanks

Replies

Replied 18 Sep 2002 17:17:58
18 Sep 2002 17:17:58 Vince Baker replied:
Add this where you want the second image to appear inside the recordset:

<% Dim str2ndImage
str2ndImage = yourRecordsetname.fields.item("your2ndimagefieldname".value
%>
<% If str2ndImage <> "" Then %>

Here is where you put the code for the dynamic image (same as you have for the first one)

<% End If %>

Regards
Vince

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

VBScript | ASP | HTML | SQL | Oracle | Hosting

Reply to this topic