Jump to content

ShowHide multiple dynamic table rows


Voodoo Jai

Recommended Posts

I want to be able to show or hide a tables row/s that are created dynamically from a database. I dont know how many rows are returned but I just would like to be able to hide them from by using a checkbox.

 

How would I do this, I have been looking at code that just hide a particular row but I cannot find multiple row hide examples.

 

VoodooJai

Link to comment
https://forums.phpfreaks.com/topic/129013-showhide-multiple-dynamic-table-rows/
Share on other sites

thet javascript

 

<script type="text/javascript">
var current = "1";
function pageSwitch(id){
if(!document.getElementById) return false;
var div = document.getElementById("page"+id);
var curDiv = document.getElementById("page"+current);
curDiv.style.display = "none";
div.style.display = "block";
current = id;
}
</script>

Links to show hide content

<li><a href="#" onclick="pageSwitch(1); return false;">Instructions</a></li>

   					<li><a href="#" onclick="pageSwitch(2); return false;">Artist</a></li>
					<li><a href="#" onclick="pageSwitch(3); return false;">Music</a></li>
					<li><a href="#" onclick="pageSwitch(4); return false;">Storys</a></li>
					<li><a href="#" onclick="pageSwitch(5); return false;">Events</a></li>				
					<li><a href="#" onclick="pageSwitch(6); return false;">Food</a></li>
					<li><a href="#" onclick="pageSwitch(7); return false;">Business</a></li>

				</ul>

Then the rows are named like below

<div class="Artist" id="page2" style="display:none;">

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.