Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Variables through Frames

Status
Not open for further replies.

johnve

Technical User
Dec 6, 2006
10
AU
I have a webpage with two frames.
Top frame has list box which stores a variable
Bottom frame has a report from which it uses a variable in the topframe.

I have search the net but cannot get it working.

Can anyone help.
 
Use a session variable instead.



Just my 2¢

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg
 
John,
I'm not sure if these are iFrames, or if it matters in this context, but I'm assuming you mean a javascript client-side variable and not a server-side session variable?

Anyway, what I've done is use a function, say the variable is foo (global), I have a function getfoo(), which just returns foo from the other frame, with:
newvariable = parent.frames.otherframe.window.getfoo()
--Jim
 
don't think you need to be so extravagent.

In the bottom frame in Javascript use:

var XXX = parent.topframename.document.formname.selectboxname.value

(topframename is the name of the top frame as defined in your frameset
formname is the name of a form containing your list box
selectboxname is the name of your list box)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top