ASP Hide text if recordset field is empty
I have an asp classic application and would like to hide some text if a recordset field is empty.
any ideas?
I have an asp classic application and would like to hide some text if a recordset field is empty.
any ideas?
<% If RecordsetName.Fields.Item("ColumnName").Value <> "" AND RecordsetName.Fields.Item("ColumnName").Value <> NULL Then %>
<%=(RecordsetName.Fields.Item("ColumnName").Value)%>
<% End If %>
Thanks Jason,
I have applied this as follows:
<% If WADAProperties.Fields.Item("SizeMax").Value <> "TO" AND WADAProperties.Fields.Item("SizeMax").Value <> NULL Then %>
<%=(WADAProperties.Fields.Item("SizeMax").Value)%>
<% End If %>
but get an error message as follows:
Microsoft JScript compilation error '800a03ec'
Expected ';' If WADAProperties.Fields
Any ideas?
That code use the ASP VB Script syntax. ASP Javascript is slightly different.
<% if (WADAProperties.Fields.Item("SizeMax").Value != "TO" AND WADAProperties.Fields.Item("SizeMax").Value != NULL) { %>
<%=(WADAProperties.Fields.Item("SizeMax").Value) %>
<% } %>
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.