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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Popup window form target = frame in opener 1

Status
Not open for further replies.

tsdragon

Programmer
Dec 18, 2000
5,133
US
Honest, I've spent the last hour looking for this and couldn't find it!

I've got a window with two frames, menuFrame and pageFrame. When you click a link in pageFrame it opens a popup window containing a short form. What I want to happen is when I submit the form in the popup the results should show up in pageFrame. I can't seem to figure out how to set the target attribute of the form to point to pageFrame. Any ideas?
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
target ="frameName" - it works. I wonder why it's not working for you? Are you testing it by examining the query string? It may be that you are trying to grab the search string, when using POST, or something like that, try it with get for a start.

Bj
 
P.S. the opener is considered to be the frame which called open() - not the frameset, as I previously thought made sense.
 
Tracy --

If pageFrame is the opener, and that's where you want the results sent, then you can just send the results to window.opener.formName.element.value --

Unless I'm misuderstanding your question.

Here's a FAQ with a very simplified solution to the problem:
faq216-692

:)
Paul Prewett
penny.gif
penny.gif
 
Actually what I want to do is have the form in the popup window update the entire frame that opened it. I'll try some of the other suggestions, although I think I've tried them before. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
howabout:

window.opener.parent.frames[1].formName.elementName.value

That would obviously need to go in a javascript function which would be called onClick of the "Submit" (not really submit) button, and would assign all the values, and then close the window --

Many times, what I will do is use something like what I showed up there, and then even call a .submit() on that form (where the form in question would have an action of itself -- recursive) -- so that the page would completely reload and display whatever.

With or without the .submit() though, that syntax should get your values over there into the other frame (assuming the index of the frame is "1", that is.)

:)
Paul Prewett
penny.gif
penny.gif
 
It isn't the values I wanted to get to the other frame. The form in the popup causes a new page to be generated, and I want that new page in the frame that opened the popup. I got it to work by using target="framename" on the form tag in the popup window. I'd been trying to set it using javascript and that didn't work, but when I hardcoded it in the form tag it worked just fine! So bangers gets the star, but thanks to all for the help.

I've been playing around with having frames affect each other in various ways and found some cool tricks. If anyone has a problem with frame interaction, I may have found a solution now.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top