troubleshooting Question

Show hide elements in repeat region

Avatar of Panos
PanosFlag for Germany asked on
JavaScript
8 Comments1 Solution327 ViewsLast Modified:
Hello experts
I have a nice solution from expert Johnsixkiller in question:https://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_23416613.html.
The question is how can i use this function in a repeat region?

<script>
  function showHide(Sender){
     var oTBody = document.getElementById("tbody"+Sender.id.substring(7));
     if(oTBody.style.display == 'none'){
       oTBody.style.display = '';
       Sender.src = '../../img/Arrowdown.gif'
     } else {
       oTBody .style.display = 'none';
       Sender.src = '../../img/Arrowup.gif'
     }
  }
</script>
<body>
<div> 
<cfoutput query="qPark" startRow="#StartRow_qPark#" maxrows="#MaxRows_qPark#">
<table cellpadding="0"cellspacing="0"  class="tablePark" border=1>
  <tr>
    <td>Test:</td>
    <td>test</td>
  </tr>
 <tr>
 <td colspan="2">
 <img onclick='showHide(this)' id="imgPlus1" src="../../img/Arrowdown.gif" alt='xxx'/></td>
 </tr>
<tbody  id='tbody1' style='display:none'>
<tr><td class="ExtrasTD" colspan="2" >#Test#</td></tr></tbody>
</table>
</cfoutput
</div>
</body>
</html>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros