?
Solved

post form1 to pop up window > post form2 on popup to self > change value form3 to main window.

Posted on 2003-02-19
4
Medium Priority
?
269 Views
Last Modified: 2009-12-16
Ok here goes!

I have a form (form1) in a main window (lets call it window no.1) that posts date values that will be calculated on a pop up window (window no.2).

Here is the code for the pop up:

<script language="JavaScript">
<!--
               function openWin(wName, wWidth, wHeight, wResize)
               {
                 features = 'scrollbars=1,status=0,resizable=' + ((wResize) ? 1 : 0) + ((wWidth) ? ',width=' + wWidth : '') + ((wHeight) ? ',height=' + wHeight : '');
                 popWin = window.open('', wName, features);
        if(popWin.focus) { popWin.focus(); }
        return true;
               }
          // -->
</script>

<form action="/PriceCalculator/popup.asp" method="post" name="CheckAvailibilty" target="newWin" onSubmit="return openWin(this.target, 370, 400, false)">

On the pop up I have a similar form (form2) that posts the values to the same page. I need some of the returned values to be 'inserted' to a seperate form (form3) on my original window (window no. 1) through a hyperlink without closing the pop-up window and without posting the page.

Somehow the first page (form and form field) needs to be referenced when opening the first pop-up I think.

I hope the above is clear. Any help will be appreciated.

Regards, Storm

0
Comment
Question by:Stormvdm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 63

Accepted Solution

by:
Zvonko earned 800 total points
ID: 7980861
Hello Storm,

normally is for this purpose the window property "opener" to be used. But I assume this property is not correctly available after your popup window is filled by the subsequent html receive.

So is my proposal to access this opener window and their forms contained in opener window by naming the opener window with a distinguish name.

Like this:
<script language="JavaScript">
<!--
              function openWin(wName, wWidth, wHeight, wResize)
              {
                features = 'scrollbars=1,status=0,resizable=' + ((wResize) ? 1 : 0) + ((wWidth) ? ',width=' + wWidth : '') + ((wHeight) ? ',height=' + wHeight : '');
                popWin = window.open('', wName, features);
       if(popWin.focus) { popWin.focus(); }
       window.name="openerWindow";
       return true;
              }
         // -->
</script>

So you can reference in your popup html script like this:

top.openerWindow.document.formName.fieldName.value="xxx";

Give it a try.

Good luck,
Zvonko

0
 
LVL 63

Expert Comment

by:Zvonko
ID: 7980876
Oh, this opener window naming is possible because you can handle window collections like frames.
The window name is then the frame name.

0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10081745
*******************************************************
******PLEASE DO NOT ACCEPT THIS COMMENT AS ANSWER******
*******************************************************
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area:
RECOMMENDATION:

 - [Points to Zvonko Grade A]

Please leave any comments here within the next seven days.
*******************************************************
******PLEASE DO NOT ACCEPT THIS COMMENT AS ANSWER******
*******************************************************

jAy
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question