<table width="225" border="0">
<tr>
<td width="10" id="MyCell1"
onclick="ShowHi de('MyRow1','My Cell1')"><img
src="images/plus3.gif"></td>
<td width="205">bla hasdfadfadfasd</strong></a></div></td>
</tr>
<tr id="MyRow1">
<td> </td>
<td>
<table width="100%" border="0">
<tr>
<td>teadasdgads f</a></td>
</tr>
</table>
</td></tr>
<tr>
<td width="10" id="MyCell2"
onclick="ShowHi de('MyRow2','My Cell2')"><img
src="images/plus3.gif"></td>
<td width="205">bla hasdfadfadfasd</strong></a></div></td>
</tr>
<tr id="MyRow2">
<td> </td>
<td>
<table width="100%" border="0">
<tr>
<td>teadasdgads f</a></td>
</tr>
</table>
</td></tr>
<tr>
<td width="10" id="MyCell3"
onclick="ShowHi de('MyRow3','My Cell3')"><img
src="images/plus3.gif"></td>
<td width="205">bla hasdfadfadfasd</strong></a></div></td>
</tr>
<tr id="MyRow3">
<td> </td>
<td>
<table width="100%" border="0">
<tr>
<td>teadasdgads f</a></td>
</tr>
</table>
</td></tr>
</table>
<script type="text/javascript">
var m_intShow = 0;
function ShowHide(strRow ID,strCellID)
{
var objRow = document.getEle mentById(strRow ID);
if (m_intShow == 0)
{
objRow.style.di splay = "block";
var objCell = document.getEle mentById(strCel lID);
objCell.innerHT ML = "<img src=images/minus2.gif>";
m_intShow = 1;
}
else
{
objRow.style.di splay = "none";
var objCell = document.getEle mentById(strCel lID);
objCell.innerHT ML = "<img src=images/plus3.gif>";
m_intShow = 0;
};
}
function runhide(){
var objs = new Array();
rowCount = this.asdfform.t xtAID.value;
for(var i=1;i<=rowCount ;i++){
(objs[i] = document.getEle mentById("MyRow "+i)).style.dis play =
"none";
}
}
runhide()
</script>
So everything works really good on load up, it loads the rows in the
tables. When the table is done, the javascript loads runhide() which
collapses all of the rows.
The javascript works fine when they click on the plus and it shows the
row, and when I click on the same plus it collapses. The problem
is...when I click the first cell, it shows the row, then If I want to
expand cell 2, I have to click it twice to get it to expand. Then when
I go to cell 1, I have to click twice to collapse it.
If anyone can correct my coding it would be appreciated, thanks.