Getting the parent of the base page that opens a ModelDialog

Posted on 2004-11-10
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 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
    LVL 6

    Expert Comment

    I really don't think that's possible.

    Author Comment

    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 or window.dialogArguments.parent works just fine. :)

    Accepted Solution

    PAQed with points refunded (100)

    Community Support Moderator

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (, typical array handling might look like this: (CODE) B…
    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…

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now