Link to home
Start Free TrialLog in
Avatar of scm0sml
scm0sml

asked on

collapsing a drilled down span.....

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
Avatar of SweatCoder
SweatCoder
Flag of United States of America image

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?
Avatar of scm0sml
scm0sml

ASKER

vbscript
ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of scm0sml

ASKER

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?
Avatar of scm0sml

ASKER

i've just seen and changed &amp;
Avatar of scm0sml

ASKER

yeah that worked actually....just a bit of syntax hadnt copied well etc............

cheers