Getting the parent of the base page that opens a ModelDialog

Posted on 2004-11-10
Medium Priority
Last Modified: 2008-01-09

I have this ModalDialog window. The opener page is inside an iframe. What i want to do is i want to reach the parent of the opener page of the dialog. You can reach the opener with window.dialogArguments. But you cannot use parent.window.dialogArguments.
To make things clear here is an example code. If i was using window.open instead of showModalDialog than my code would look like this.

function someFunction()
    valueIWantToGet = opener.parent.document.all.tags( "INPUT" )( "someField" ).value;

but since i am using a Modal Dialog the code has to be like this.

function someFunction()
    windowOpener = window.dialogArguments;
   //Here in the line above we get the opener window.No prob. so far.
    valueIWantToGet = windowOpener.parent.document.all.tags( "INPUT" )( "someField" ).value;
    //But when we try to get the parent of the opener window then the problems start

So if anybody knows the solution please share it with me. :) Thanks...
Question by:Goa_Koala

Expert Comment

ID: 12567296
I really don't think that's possible.

Author Comment

ID: 12601896
No it's possible. I managed :))

when you are opening the modalDialog you open it like this

window.showModalDialog( 'urlOfTheWindow', window, 'parameters' );

you write window( without "" or '' ) in the middle, where you actually write the title of the window. after that

window.dialogArguments.top or window.dialogArguments.parent works just fine. :)

Accepted Solution

modulo earned 0 total points
ID: 13767190
PAQed with points refunded (100)

Community Support Moderator

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

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

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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

578 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