Solved

collapsing a drilled down span.....

Posted on 2006-06-28
6
247 Views
Last Modified: 2006-11-18
i have a button that causes a row to be inserted into the table directly below the row of the button....using............:

<tr>                              
                  <td><input type=button name="btnClose" Value="View Agent" onClick="displayAgent('<%=nameString%>')" ID="Button2"></td>
                  <td><input type=button Value="+" onClick="displayDrill('<%=rst("Bcode")%>')" ID="Button1"></td>
                  <td><%=rst("Bcode")%></td>
                  <td><%=nameString%></td>
                  <td><%=formatdate(rst("departuredate"))%></td>
                  <td><%=formatdate(rst("bdate"))%></td>
                  <td><%= FormatNumber(rst("tot"),2)%></td>
            </tr>
            <TR><td colspan=10>
            <Span id=spn<%=rst("Bcode")%>>
            
             </Span>
            </td></TR>


with the function:
function displayDrill(Bcode)
      document.all("spn" & Bcode).innerhtml =  "<TD>HELLOOOO</TD>"
end function


can someone tell me how id go about collapsing the row again if the user clicked the button again.

cheers
0
Comment
Question by:scm0sml
  • 4
6 Comments
 
LVL 11

Expert Comment

by:SweatCoder
Comment Utility
Are you using javascript to do this? If so, not sure why you're posting this in ASP section. Did you put your function inside javascript tags?
0
 

Author Comment

by:scm0sml
Comment Utility
vbscript
0
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
Comment Utility
If you just wanted to clear it out you could use something like:

    Function displayDrill( Bcode )

        curText = document.all("spn" & Bcode).InnerHtml
        If curText <> "" Then
            document.all("spn" & Bcode).InnerHtml = ""
        Else
            document.all("spn" & Bcode).InnerHtml = "<td>HELLOOOO</td>"
        End If

    End Function
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:scm0sml
Comment Utility
function displayDrill(Bcode)
      curText = document.all("spn" & Bcode).InnerHtml
      If curText <> "" Then
            document.all("spn" &amp; Bcode).InnerHtml = ""
      Else
            document.all("spn" &amp; Bcode).InnerHtml = <td>HELLOOOO</td>"
      End If            
      'document.all("spn" & Bcode).innerhtml =  "<table><tr><TD>HELLOOOO</TD>"
end function

thats what I've got now but its stopped working completely?
0
 

Author Comment

by:scm0sml
Comment Utility
i've just seen and changed &amp;
0
 

Author Comment

by:scm0sml
Comment Utility
yeah that worked actually....just a bit of syntax hadnt copied well etc............

cheers
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now