Solved

showModalDialog call function on parent page

Posted on 2004-08-13
1
568 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Jquery 2 23
Access RV042 GUI / Browser Issues 25 49
How can in rewrite this js anonymous function as a named function 26 32
Fix Form size HTML 16 15
In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
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…

828 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