This topic is locked

Hiding content

1/12/2007 3:55:33 PM
ASPRunnerPro General questions
S
swiersman author

I would like to hide 10 fields that appear in my Add.asp and Edit.asp pages and allow them to be unhidden with a button shown on the same page. How do you do this?
Can I use <div> or <span> actions on these pages? If so where?
I f I can do the above, where should I put the button code?
Any help would be great...
Thanks

C
clig 1/13/2007

in list.asp
you'd want something in the <head> like
<script type="text/vbscript" language="vbscript" event=onclick for=ButtonID>

<!--
localehidden & "<%= xtr %>".style.visibility="visible"

  • you'd have to loop a counter of some sort as each row has to have a unique id

    -->

    </SCRIPT>
    the row
    <%

    response.write("<td style=""visibility:hidden"" id=localehidden") & (xtr + 1) & ">"

    key=""

    if strKeyField<>"" then key = GetData(rs.Fields(strKeyField), "")

    key2=""

    if strKeyField2<>"" then key2 = GetData(rs.Fields(strKeyField2), "")

    key3=""

    if strKeyField3<>"" then key3 = GetData(rs.Fields(strKeyField3), "")
    strImageWhere = " " & KeyWhere(key,key2,key3)
    %>
    <%

    if IsBinaryField(rs.Fields("NTSS Role")) or Format("NTSS Role")=FORMAT_DATABASE_FILE then

    Response.Write CreateImageControl(rs, "NTSS Role", "")

    else

    strData = GetData(rs.Fields("NTSS Role"), "")
    if Format("NTSS Role")<>FORMAT_HTML then

    Response.Write ProcessLargeText(strData,"picfield=" & Server.URLEncode("NTSS Role") & "&where=" & Server.URLEncode(strImageWhere),"",MODE_LIST)

    else

    Response.Write strData

    end if
    end if

    response.write("</td>")

    xtr = xtr + 1
    %>
  • The above code works at hiding the values for a column but leaves the column header in place - add a style to the header of the column...
    so if you look at the source each <TD> </td> for the column has an incremented number appended to "localehidden" - this is what you'd have to loop for...
    so to test
    <script type="text/vbscript" language="vbscript" event=onclick for=ButtonID>

    <!--
    localehidden1.style.visibility="visible"
    -->

    </SCRIPT>
    would set the first cell of the column to visible....