hi - i use the following function to make rows of a table show/hide when an image is clicked and change the image [from down to up arrow].
this worked fine but now i need the same effect on dynamic rows that are created within an asp loop.
i can change the id of each row with asp.
if my asp code helps let me know - the html below is the static rows
hope i make sense
static html
dynamic asp/html table
this worked fine but now i need the same effect on dynamic rows that are created within an asp loop.
i can change the id of each row with asp.
if my asp code helps let me know - the html below is the static rows
hope i make sense
Code:
<script>
//showhide
function showHide(inrow) {
rowArr = inrow.split(",")
for (x=0; x<rowArr.length; x++){
theRow = document.getElementById(rowArr[x])
theRow.style.display = theRow.style.display == "none" ? "block" : "none"
}
}
function chgimg(obj) {
obj.src=(obj.src.indexOf("showbut2.gif")!=-1)? "images/hidebut2.gif":"images/showbut2.gif";
}
</script>
static html
Code:
<input name=showhide type=image onClick=showHide('discrow1,discrow2');chgimg(this);return false; src=images/showbut2.gif width=13 height=9>
<table>
<tr id="discrow1" style="display: none;">
<td>...data</td>
</tr>
<tr id="discrow2" style="display: none;">
<td>...data</td>
</tr>
</table>
dynamic asp/html table