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
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;">

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.