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

Passing data back to Parent from IFrame

Status
Not open for further replies.

NeeNee

Programmer
Apr 2, 2002
97
CA
I need to validate a customer number on a Purchase requisition form. I am trying to use an IFrame to retrieve the vendor info and pass it back to the parent form. I can get the IFrame source ASP page to get the record, but I can seem to access the parent object from within the IFrame. I tried parent.parent, parent.top and parent.document, but they all say they can't find the object.

What am I missing? Is it no possible to access the parent from an Iframe? Is there security involved?

Thanks

Denis
Programmer, Canada
 
You can reference the Parent through an iframe with window.opener I'm pretty sure (not 100% sure).

[monkey][snake] <.
 
Are the two pages coming from different (according to the browser) domains? If your parent page URL is and your iframe is loading up then regardless of whether the two addresses actually point to the same box or not, the browser will interpret it as an attempt at cross-domain scripting.

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.

Enable Apps
 
Both pages are in the same directory. The main page passes the vendor number through the iFrame ulr. The iFrame ASP page takes the vendor number from the querystring and retreives the vendor record if there is one. My page currently displays the vendor record correctly. I am just trying to find a way to pass the information back to the main page. I will then hide the iframe page and make the validation transparent to the user.


Denis
Programmer, Canada
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top