[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

collapsing a drilled down span.....

Posted on 2006-06-28
6
Medium Priority
?
261 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
ID: 17001031
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
ID: 17001042
vbscript
0
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 total points
ID: 17001157
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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:scm0sml
ID: 17001217
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
ID: 17001284
i've just seen and changed &amp;
0
 

Author Comment

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

cheers
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month18 days, 3 hours left to enroll

829 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