...

View Full Version : getting vars across frames



froth
03-25-2005, 09:07 PM
i have two frames on my page. one of them is named "forum" and it has an input field named "name" under a form named "form1". i'm trying to write the value of "name" on the other frame. I tried

document.write(parent.frames["forum"].form1.name)
in the other frame but it didnt work. any suggestions?
Also is there any way to execute a function in frame2 that is located in frame1?

Mr J
03-26-2005, 01:53 PM
Please try the following

parent.frameName2.document.write(parent.forum.form1.name.value)

It is also advisable not to use the word name as a name as this is reserved word.

Use something like isName or oName or even name1

If you already have a page in your second frame then you'd be better targeting a div

parent.frameName2.document.getElementById("div1").innerHTML=parent.forum.form1.name.value

In frame 2 you would have

<div id="div1"></div>

Just a thought.....



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum