[Javascript] Tricky frame problem.

Rick Holcomb rholcomb at holc.biz
Wed Jan 25 22:31:25 CST 2006


I have a frameset that contains two frames a top and a main frame.
I use the top as a menu and load all the pages into the main frame.
My problem is that I have designed a new page that contains frames itself.
The frames in the new page are topFrame, leftFrame and mainFrame.
When I post values from mainFrame to leftFrame using a script in topFrame,
everything works fine. But once I add this frameset to the first frameset
all hell brakes loose. So main will now conatin topFrame, leftFrame and
mainFrame.

The javascript call I make from mainFrame to topFrame is:

parent.passText2('value')

The script in topFrame that posts the value to leftFrame is:

function passText2(str) {
if (top.frames['leftFrame'].document.theForm.txtBucket.value == "")
   {
   top.frames['leftFrame'].document.theForm.txtBucket.value =
top.frames['leftFrame'].document.theForm.txtBucket.value + str;
   }
else
   {
   top.frames['leftFrame'].document.theForm.txtBucket.value =
top.frames['leftFrame'].document.theForm.txtBucket.value + "," + str;
   }
}

Can anyone tell me how I can get this to work?
Is the top.frames part of this screwing me?

Thanks,

Rick






More information about the Javascript mailing list