Click to See Complete Forum and Search --> : passing values between windows


esthera
09-06-2003, 01:46 PM
I have a parent form called frmNews that opens a modal pop up window with an iframe. The iframe posts to another page and after the asp code is processed I want to pass a value back to the parent. I have tried the following and they don't seem to work. Any ideas?


parent.top.opener.document.frmNews.mynewfilename.value=imgSrc;

parent.iframeimage.top.opener.document.frmNews.mynewfilename.value=imgSrc;

top.opener.document.frmNews.mynewfilename.value=imgSrc;

self.parent.close(); works to close itself

Khalid Ali
09-06-2003, 01:59 PM
this line

parent.iframeimage.top.opener.document.frmNews.mynewfilename.value=imgSrc;

should work to send data from child+iframe to parent form,however if you are trying to send data back from asp page to parent then you are totally wrong.
for that you only need toset the target in the forms target attribute which inthis case will be
from child window

top.opener

and from frame in child window

parent.frameName.top.opener

esthera
09-07-2003, 01:14 AM
The parent addarticle.asp opens a modal window called getimage.asp which has an iframe. That file post to an asp file called addimage.asp. From that asp file I would like to send a value to the parent window?

parent.iframeimage.top.opener.document.frmNews.mynewfilename.value=imgSrc;

does not work.

esthera
09-07-2003, 02:39 AM
I tried this also from the iframe and it didn't pass back the value correctly.

any ideas>

Khalid Ali
09-07-2003, 10:02 AM
Originally posted by esthera
I tried this also from the iframe and it didn't pass back the value correctly.

any ideas>

your implementation of the code is wrong.

Please post a link to the pages in question...or upload all the resources as ziped file....

esthera
09-07-2003, 10:12 AM
I just found a round a bout way to do it directly from the iframe by returning the value to the variable that called the modal window.

Thanks for your help

esthera
09-09-2003, 07:04 AM
actually It would be much better to do it after the asp then before the asp is processed.
attached is a zip. Can you let me know if you can figure out what i did wrong.

The code I did in getimage1.asp was my workaround. The code that I want to get working is on line 60 of addimage.

Thanks for your help