
Originally Posted by
Pepejeria
Ok, it is getting a bit confusing now, maybe I am slow here, but could you please show the latest showtab function and the actual function call with or without what you will need for it to work?
PHP Code:
<script type="text/javascript">
function getElementsByClass( searchClass, domNode, tagNames) {
if (domNode == null) domNode = document;
if (tagNames == null) tagNames = '*';
var el = new Array();
var tags = domNode.getElementsByTagName(tagNames);
var tcl = " "+searchClass+" ";
for(i=0,j=0; i<tags.length; i++) {
var test = " " + tags[i].className + " ";
if (test.indexOf(tcl) != -1)
el[j++] = tags[i];
}
return el;
}
function showtab(tabname)
{
var tabs = getElementsByClass('tab');
for(i=0; i<tabs.length; i++)
ID = document.getElementById(tabname);
if(ID.style.display == ""){
ID.style.display = "none";
}
else{
ID.style.display = "";
}
}
</script>
PHP Code:
<tr>
<td align='center'><a href="#" onclick="showtab('tab4');">tab4</a>2</td>
</tr>
<tr class="tab bgray" id="tab4" style="display: none;">
<td align='center' colspan='6'>a</td>
</tr>
<tr class="tab bgray" id="tab4" style="display: none;">
<td align='center' colspan='6'>b</td>
</tr>
<tr class="tab bgray" id="tab4" style="display: none;">
<td align='center' colspan='6'>c</td>
</tr>
onclick it only displays 1st row 'a', i need to show/hide all 3 rows at same time.
thanks
Bookmarks