Click to See Complete Forum and Search --> : Modifiying a Frame


MstrBob
01-12-2004, 05:50 PM
Ok, so basically what I have is a frame. In one frame is a form and in the other frame is a page that they modify with the frame. My problem arises with the fact that I can't for the life of me figure out how to get the function in the left frame to modify the right window.

So basically the script takes the information from the form fields and then rewrites the left sample frame only to the parameters of the form. Such as color equals the color the user entered into the color field. However



document.write("all the html here");

and

window.frame.framename.document.write("html here");



As you can see from that, I'm not very advanced at JavaScript. I just can't get JavaScript to modify that other frame. Normally the only thing I manage to get is an Error: Object does not support Method or Property. Please shed light on my confusion!

lisawebs
01-12-2004, 06:38 PM
theeasiest and stable way to do this is:

to call a function on frameB, passing the
values you want to use to update things there.

Asume the form is on frameA,
there you use:
parent.framename.functioname(parameters)

where framename is the NAME on the frameset,
NOT the name of the htm.file!

if you have lots of parameters to pass,
then put them on an array an pass the whole array
as a parameter.

remember that from any frame
(of the same level or frameset)
you can directly refer to variables on frames
using parent.framename.whatever

in the form example could be
variable = parent.framename.formname.inputfield.value

but you cannot do this:
parent.framename.formname.inputfield.value = 1


hope this could be of any help (or light)

MstrBob
01-12-2004, 06:45 PM
Thank You! It appears to be working nicely!