Forums

ASP

This topic is locked

hiding a row problem

Posted 09 Jul 2002 07:09:09
1
has voted
09 Jul 2002 07:09:09 Joseph Marshall posted:
I am trying to hide a row is a field is empry but i am have a small problem. This is my code:

<% If <%=(showmaster.Fields.Item("Show Comments".Value)%> <> "" Then %>
<tr>
<td width="81" valign="top" align="left"><b>Comments:</b> </td>
<td><%=(showmaster.Fields.Item("Show Comments".Value)%></td>
</tr>
<% End If %>

The if statement works because if <%=(showmaster.Fields.Item("Show Comments".Value)%> = "" then the row is hiden and if it does not equal "" then the row is shown. The problem I am having is that when i add this If statement the <%=(showmaster.Fields.Item("Show Comments".Value)%> that is within the table does not show. I can not figure why it is doing this.

Thanks for any of your help
joe marshall

Replies

Replied 09 Jul 2002 10:32:39
09 Jul 2002 10:32:39 Andrew Watson replied:
Youve just nested ASP code and it doesnt like that...!

try this.,


<pre id=code><font face=courier size=2 id=code>
&lt;% If showmaster.Fields.Item("Show Comments".Value &lt;&gt; "" Then %&gt;
&lt;tr&gt;
&lt;td width="81" valign="top" align="left"&gt;&lt;b&gt;Comments:&lt;/b&gt; &lt;/td&gt;
&lt;td&gt;&lt;%=(showmaster.Fields.Item("Show Comments".Value)%&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;% End If %&gt;

Cheers,
Leed
</font id=code></pre id=code>

:: Son, im Thirty.... ::
Replied 09 Jul 2002 18:01:20
09 Jul 2002 18:01:20 Joseph Marshall replied:
leed, I tried what you said and it is still doing the same thing ... if "Show Comments" = "" then it is hidden but if it is not then the row is shown but the &lt;%=(showmaster.Fields.Item("Show Comments".Value)%&gt; is not.

any other suggestions?
Replied 09 Jul 2002 19:44:40
09 Jul 2002 19:44:40 na na replied:
Try:

&lt;% If (showmaster.Fields.Item("Show Comments".Value) &lt;&gt; "" Then %&gt;

Peace

"EFFICIENCY IS INTELLIGENT LAZINESS." --DUNHAM
Replied 09 Jul 2002 21:39:21
09 Jul 2002 21:39:21 Joseph Marshall replied:
still does the same thing ... all three:

&lt;% If &lt;%=(showmaster.Fields.Item("Show Comments".Value)%&gt; &lt;&gt; "" Then %&gt;
&lt;% If showmaster.Fields.Item("Show Comments".Value &lt;&gt; "" Then %&gt;
&lt;% If (showmaster.Fields.Item("Show Comments".Value) &lt;&gt; "" Then %&gt;

they all do the same thing. and the If command works properly. it just that the Dynamic Text within the statement doesnt show.

any other suggestions???

thanks
joe

Reply to this topic