PDA

View Full Version : hidden field variable for conditional content


meth
03-15-2003, 09:05 PM
This problem revolves around a repeating recordset using 1 recordset and 1 asp conditional statement to determine conditional content.

the table row making up the repeating recordset contains a hidden field "R_edited" with a dynamic value (from the above recordset) of "1" or "0" in an access db table.

I want static and dynamically bound content to appear in the repeating recordset depending on "R_edited" value.

script I'm using is


<% IF (Request.Form("R_edited") <> "0") THEN %>
Edited by: <%=(dynamicContent).Value)%> | on: <%=(dynamicContent).Value)%>
<% ELSE %>
@nbsp;(sic)
<% END IF %>


This script works of sorts, except the "Edited by: | on: " is displayed regardless of R_edited's value ("1" = display content, "0" = hide content)

Is this problem occurring because it is a repeating recordset ? I've used this means of conditional content many times (Request.Form and Request.QueryString), but not in this situation...

scroots
03-15-2003, 09:11 PM
<% IF (Request.Form("R_edited") <> "0") THEN %>
Edited by: <%=(dynamicContent).Value)%> | on: <%=(dynamicContent).Value)%>
<% ELSE %>
@nbsp;(sic)
<% END IF %>

from what you put aslong as it isn't zero so it can be empty. I would put

<% IF (Request.Form("R_edited") = "1") THEN %>
Edited by: <%=(dynamicContent).Value)%> | on: <%=(dynamicContent).Value)%>
<% ELSE %>
@nbsp;(sic)
<% END IF %>


scroots

meth
03-15-2003, 10:47 PM
I've tried that. With that value of, = "1", the content does not show for any record regardless of the dbtable value. When, <> "0", or <> "" is used, the content shows in all records as stated previously.

scroots
03-16-2003, 09:58 AM
IF (Request.Form("R_edited") = 1 THEN
'write whatever
END IF


scroots