Click to See Complete Forum and Search --> : loading a second frameset


ksynergy
10-29-2003, 02:44 PM
Hello,
I have a frameset with three frames. Header runs across the top of the window, Menu_List runs down on the left side for navigation and Main is the third frame and takes the rest of the space. Now I need to open a new frameset inside Main (the third frame), based on a choice in a dropdown menu in the Menu_List frame.

I can get this to work from a simple text link that references the second frameset and targets Main (e.g. <a href="new_frameset.cfm?ID=40" target="Main">Link</a>). But I'm not sure of the syntax in making a similar connection via a selectbox choice.

Here is the script that I am starting with:
function checkMenu(param) {
if (param != "'','','',''")
eval('loadFrames(' + param + ')');
}
function loadFrames(frame1,page1,frame2,page2) {
eval("parent."+frame1+".location='"+page1+"'");
eval("parent."+frame2+".location='"+page2+"'");
}

In the form, the selectbox looks like this:

<select name="Link_List" id="Link_List" size="1" onChange="checkMenu(this.options[this.selectedIndex].value)">
<option value="Select a link" selected="'','','',''">Select a link</option>
<option value="'Frame_A','tabs.cfm?ID=1', 'Frame_B','greeting_page.cfm?ID=1'">First choice</option>
</select>

This will do what is expected if it is one frameset. However, I'm not clear about what the sytax would have to be when the script is operating in one frameset and trying to open another frameset inside a frame.

I suspect that someone more familiar with frames and the document object model would see this as simple, but I haven't found any examples that I can apply.

Any help would be greatly appreciated. Thanks.

Khalid Ali
10-30-2003, 07:49 AM
If I understadn your question correctly,
you want to oen another frameset from within a frame in a frameset.

1. first get reference to the frame you are in, which is typically
var frame1 = parent.frameName;
now you want to open another frameset in this frame,
create frameset page that has multiple frames in it say its called.
internalFrameset.cfm
now just open it using

frame1.location.href = "internalFrameset.cfm"