Voodoo Jai Posted October 18, 2008 Share Posted October 18, 2008 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 More sharing options...
dropfaith Posted October 19, 2008 Share Posted October 19, 2008 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 https://forums.phpfreaks.com/topic/129013-showhide-multiple-dynamic-table-rows/#findComment-668976 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.