*solved*Is there a way to hide empty fields and the text with them? (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


lovduv -> *solved*Is there a way to hide empty fields and the text with them? (11/16/2005 21:51:47)

I use the following code to hide an empty DB field:

<b><font size="1" color="#0000FF">Comment Posted on
<%=FP_FieldVal(fp_rs,"CommDate")%><%If len(trim(fp_field(fp_rs,"CommDate")))>0 then%>
<%=fp_field(fp_rs,"CommDate")%>
<%End if%></font></b><p>

If there is data in the field then it looks like:
Comment posted on <<CommDate>>

Is there a way to hide the text "Comment Posted on" to if a field is empty?

lovduv




lovduv -> RE: Is there a way to hide empty fields and the text with them? (11/16/2005 23:16:43)

I tried this:
<b><font size="1" color="#0000FF">
<%If FP_FieldVal(fp_rs,"CommDate")<>" "then
response.write '"Comment Posted on"&FP_FieldVal(fp_rs,'CommDate')&"</font>"%>
<%=FP_FieldVal(fp_rs,"CommDate")%><%If len(trim(fp_field(fp_rs,"CommDate")))>0 then%>
<%=fp_field(fp_rs,"CommDate")%>
<%End if%></font></b><p>

And I got this
Microsoft VBScript compilation error '800a040e'

'loop' without 'do'

/_fpclass/fpdbrgn2.inc, line 5

Loop
^

...I am so clueless...help...please

lovduv




lovduv -> RE: Is there a way to hide empty fields and the text with them? (11/16/2005 23:30:01)

I feel like it's my use/or non-use as the case may be of "

.....I love ASP, when I can strangle it into doing what I want it to do!

[>:]




lovduv -> RE: Is there a way to hide empty fields and the text with them? (11/17/2005 0:12:09)

Ok, i tried this:
<% if Trim(FP_Field(fp_rs,"CommDate")) > "" then
response.write("<font>Comment Posted On </font>& FP_Field(fp_rs,"CommDate")")
else If len(trim(fp_field(fp_rs,"CommDate")))>0 then%><%=fp_field(fp_rs,"CommDate")%>
<%End if%>


And it gave me this:
Microsoft VBScript compilation error '800a03ee'

Expected ')'

/missyblog1.asp, line 173

response.write("<font>Comment Posted On </font>& FP_Field(fp_rs,"CommDate")")
-----------------------------------------------------------------^




Spooky -> RE: Is there a way to hide empty fields and the text with them? (11/17/2005 0:46:56)

Like so?

<%If len(trim(fp_field(fp_rs,"CommDate")))>0 then%>

<b><font size="1" color="#0000FF">Comment Posted on
<%=FP_FieldVal(fp_rs,"CommDate")%>
</font></b><p>

<%End if%>




lovduv -> RE: Is there a way to hide empty fields and the text with them? (11/17/2005 5:54:40)

Your a star![8D]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.09375