
add new option item to the select from another frame
To access a window's children try something like...
from "frame1"...
var ParentWin = window.parent;
var Frame2Win = ParentWin.frames.item("frame2");
Frame2Win should then be accessible to script. However, your call to
create a new Option("111") must be called from within "frame2" in
order to create the new element within Frame2's DOM. So there must be
some function within frame2 that will include the code to create the
new Option. This function can be called from other frames or the
parent Frames Page.
However, it is possible to place script functions in the Frames Page
as well.
you may have a function in the Frames Page like
AddFrame2Option(OptionID)
{
var Frame2 = window.frames.item("frame2");
Frame2.AddOption(OptionID);
Quote:
}
or
from frame 1 you may call
var ParentWin = window.parent;
var Frame2Win = ParentWin.frames.item("frame2");
Frame2Win.AddOption(OptionID);
Note: this is all pseudo-code that I haven't explicitly tested, but
It could lead you in the right direction.
Good Luck,
lws
On Tue, 11 Jul 2000 11:25:32 +0200, "Barnabas Mudri"
Quote:
>Hi All,
>I'd like to add a new item to the select object, that is in the another
>frame.
>the following command doesn't work from frame2, the frame1 and frame2 are
>children frames.
>parent.frame1.document.form1.products[parent.frame1.document.form1.products.
>options.length] = new Option("111");
>Thanks
>Barna
Software Engineer
24/7 Systems, Inc.
www.tf7.com