?
Solved

showModalDialog call function on parent page

Posted on 2004-08-13
1
Medium Priority
?
589 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 63

Accepted Solution

by:
Zvonko earned 800 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…
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

762 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