Solved

showModalDialog call function on parent page

Posted on 2004-08-13
1
553 Views
Last Modified: 2012-06-27
i open a modal dialog and i need to call a function on the parent page.  I don't know how to access the parent window though.  I've tried several things.  opener is undefined.  self.parent, window.parent, parent, etc don't work.  Its a word processor.  The modal dialog get values from the user for a dynamic table and then the function i'm trying to call would insert the table into the editor.  i'd much rather be able to call the function from the modal dialog, but if its not possible i need a way to pass the values from the modal dialog back to the parent window.  any ideas??
0
Comment
Question by:tricos1
1 Comment
 
LVL 63

Accepted Solution

by:
Zvonko earned 200 total points
ID: 11793290
Look here:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/showmodaldialog.asp

Therin you see that the second parameter is the place where you pass the argument or argument array to modal dialog.
Modal dialog can access then the passed parameters trugh the predefined property:
window.dialogArguments

The passed argument to the modal dialog can be also the calling parent window reference: window
So you can access anything on opener window trough dialogArguments if the argument was: window
Now you can directly set the response vars in opener window or pass some results trough the returnValue property.


0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

747 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

11 Experts available now in Live!

Get 1:1 Help Now