snowboardr
Programmer
I have working show / hide table row code (see below)
How can i do an javascript function that checks to see if the cell is being closed or opened so then I can load a different page on close in the iframe
this is my code for loading the iframe page
as you can see below i load the page i want when they "open the row" but I want to change it back to "blankpage.html" when they close it.... this way its more efficient.. and other reasons too..
thanks a million!
How can i do an javascript function that checks to see if the cell is being closed or opened so then I can load a different page on close in the iframe
this is my code for loading the iframe page
Code:
function loadIframe(iframeName, url) {
if ( window.frames[iframeName] ) {
window.frames[iframeName].location = url;
return false;
}
else return true;
}
Code:
<script type="text/javascript">
/* call onload with table id(s) */
function TR_set_toggle()
{
/* toggleRow method */
var toggleRow = function()
{
this.style.display = ((this.style.display == '') ? 'none' : '');
return false;
}
for (var oTable, a = 0; a < arguments.length; ++a)
{
oTable = document.getElementById(arguments[a]);
var r = 0, row, rows = oTable.rows;
while (row = rows.item(r++))
row.toggle = toggleRow;
}
/* convenience function */
self.toggleRow = function(row_id)
{
document.getElementById(row_id).toggle();
}
}
onload = function()
{
TR_set_toggle('foo');
}
function loadIframe(iframeName, url) {
if ( window.frames[iframeName] ) {
window.frames[iframeName].location = url;
return false;
}
else return true;
}
</script>
as you can see below i load the page i want when they "open the row" but I want to change it back to "blankpage.html" when they close it.... this way its more efficient.. and other reasons too..
Code:
<a href="#null" class="cli" onclick="toggleRow('rowid<%=tid%>');loadIframe('frame<%=tid%>','post.asp')">
thanks a million!