C
Chris New
G'Day All
I am having trouble dynamically assigning a value to a table's cell
from one frame to another frame.
I've created a website that is primarily viewed in a frameset
consisting of 2 frames - a navigation frame (navFrame) at the top and
a contents frame (mainFrame) on the bottom. In all instances, the
mainFrame displays a single page except in one case, where it was
necessary to use a frameset consisting of a left frame (controlFrame)
and a right frame (tableFrame).
The tableFrame contains an HTML table used to display items that are
added or removed using the controlFrame through the use of JavaScript
functions. This used to be on a single page and all worked fine, but
it became necessary to break it out into frames since the tableFrame
required scrolling and I didn't want the controlFrame contents to
scroll out of sight.
In the controlFrame, there is a ListBox (cbSelection) and buttons to
perform things like ClearTable, SaveTable, etc. If I can get the
adding of data to the table done, the rest should fall into place and
this is where your help can get me throught it.
Initially, when all was on a single page, the following code performed
as expected:
After reading through the NG's to get an idea of how to proceed with
communicating across frames, I have tried (and failed to get working)
the following methods:
What am I doing wrong here? Am I somewhere in the ballpark with the
direction in which I'm trying to accomplish this task? Is there a
better way to do this?
Please post all answers to the newsgroup so that others might benefit
from your expertise as I am sure I'm not the only one to run into
this.
Cheers,
Chris.
I am having trouble dynamically assigning a value to a table's cell
from one frame to another frame.
I've created a website that is primarily viewed in a frameset
consisting of 2 frames - a navigation frame (navFrame) at the top and
a contents frame (mainFrame) on the bottom. In all instances, the
mainFrame displays a single page except in one case, where it was
necessary to use a frameset consisting of a left frame (controlFrame)
and a right frame (tableFrame).
The tableFrame contains an HTML table used to display items that are
added or removed using the controlFrame through the use of JavaScript
functions. This used to be on a single page and all worked fine, but
it became necessary to break it out into frames since the tableFrame
required scrolling and I didn't want the controlFrame contents to
scroll out of sight.
In the controlFrame, there is a ListBox (cbSelection) and buttons to
perform things like ClearTable, SaveTable, etc. If I can get the
adding of data to the table done, the rest should fall into place and
this is where your help can get me throught it.
Initially, when all was on a single page, the following code performed
as expected:
Code:
.... Variable Declarations and Intializations ...
iIndex = document.Form1.cbSelection.selectedIndex
strItem = document.Form1.cbSelection.options[iIndex].text
strContent = document.Form1.cbSelection.options[iIndex].value;
strTableCell = "R" + iRow + "C" + iColumn;
document.getElementById(strTableCell).innerHTML = strItem;
strTableCell = "R" + iRow + "C" + (iColumn + 1);
document.getElementById(strTableCell).innerHTML = strContent;
After reading through the NG's to get an idea of how to proceed with
communicating across frames, I have tried (and failed to get working)
the following methods:
Code:
parent.document.frames["tableFrame"].getElementById(strTableCell).innerHTML
= strContent;
Code:
parent.document.frames.item('tableFrame').getElementById(strTableCell).innerHTML
= strContent;
Code:
parent.document.frames['tableFrame'].getElementById(strTableCell).innerHTML
= strContent;
Code:
parent.document.tableFrame.getElementById(strTableCell).innerHTML =
strContent;
Code:
top.mainFrame.tableFrame.getElementById(strTableCell).innerHTML =
strContent;
Code:
parent.tableFrame.getElementById(strTableCell).innerHTML = strContent;
Code:
window.mainFrame.tableFrame.getElementById(strTableCell).innerHTML =
strContent;
What am I doing wrong here? Am I somewhere in the ballpark with the
direction in which I'm trying to accomplish this task? Is there a
better way to do this?
Please post all answers to the newsgroup so that others might benefit
from your expertise as I am sure I'm not the only one to run into
this.
Cheers,
Chris.