PDA

View Full Version : Data from popup form to main form


trice
10-25-2002, 09:15 PM
I have a form that has a link to a popup form that calculates an insurance premium.

What I need to be able to do is click the "Accept" button and copy the info from several fields on the popup to the main form.

I have tried several things. The last being the following:

In the main form I have this:
function owin(url) {
myPopup='';
myPopup=window.open(url,'popupWindow');
if (!myPopup.opener)
myPopup.opener=self;
}

In the popup form I have this:
function cpyDta(){
window.opener.document.FrontPage_Form1.GULCov.value=document.GUL.ECov.value;
window.opener.document.FrontPage_Form1.submit();
window.close();
return false;
}

When I click the accept button, it does close the window, but it doesn't write the info to the textbox. The other problem I am having also, is that if the textbox in the main form isn't a number, it gives me an error message.

I hope someone can point me in the right direction.

Thanks in advance.
Trice

beetle
10-25-2002, 09:33 PM
Read these, particularly the first one. They are almost identical in nature to your problem

http://www.codingforums.com/showthread.php?s=&threadid=8582
http://www.codingforums.com/showthread.php?s=&threadid=6954

I recommend this method instead of going to the opener window and pulling the values directly from the form, because at some point down the road you may not use the popup, in which case this script (which I ever so humbly authored :D) will still work.

trice
10-25-2002, 09:43 PM
Hi beetle,

Thank you so much for answering me! I am so lost today. I am printing out the threads and will take them home with me and work on it over the weekend.

I'll let you know if I am successful or not (mostly likely not, because that is how this week was!).

Thanks again.
Trice