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

PopUp Window Insert To Old Window

Status
Not open for further replies.
May 9, 2000
446
GB
Hi , i've got a page with 4 frames on it. Frame 4 holds a form that requires the user to enter a code into. As there's loads of codes i've put a button on the page that opens a popup window to a code search screen. Anyone know how i can have a button in the popup search screen that puts the code currently shown into a text box on the original frame 4 page??? (Kinda like the address book popup used by hotmail)

Cheers in advance....
 
You'll use the javascript:

window.opener

to reference your "parent" page. Here's a FAQ from the javascript section with a very simplified (but functional) example of how this is done.

faq216-692

good luck! :)
Paul Prewett
penny.gif
penny.gif
 
You should be able to refer to the value of the text box control on the frame4 page from the pop up window. The Frame4 page opens the pop up window, so the Frame4 page can be referenced from the "child" pop up window by using Window.Opener.

So in the code on the pop up window, in client side script (keep in mind I'm using VBScript here), include the following code (you could probably put this into the Window_OnLoad event of the pop up window):

----------------------
Dim strCodeToDisplay

strCodeToDisplay = Window.Opener.Document.txtCode.Value
Document.all.txtPopUpCode.Value = strCodeToDisplay
-----------------------
'txtCode refers to the name of the textbox on your main window (frame4) and txtPopUpCode refers to the textbox you want to populate on your pop up screen.

I hope this helps.
Rich
 
WOW! Chers for the quick response, i'll try 'em both out
Thanks again
Gary
 
Another further question! Is it possible to insert from the popup window into the frame in the main window if the popup has been used to display 2 previous pages, the popup's third and final page shows the result of a couple of searches and i want this result to be put into the text box in one of the original windows frames.....

Cheers in advance....
 
Whatever is on the popup screen can be transferred over to the frame in the main window. The value can be in a hidden input tag on the third and final page (if it was originally on one of the two previous pages in the popup).

Rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top