Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modifying parent data from modal dialog

variable passing

Modifying parent data from modal dialog

by  dace  Posted    (Edited  )
It's possible to modify the variables of a parent window from a modal dialog. The key is to pass in "window.self" as the second parameter to showModalDialog:

In the parent:
Code:
parentVar = "set by parent";
vRv = window.showModalDialog("modalWindow.html",window.self, "");

In the modal:
Code:
dialogArguments.parentVar = "set by modal";

This allows you to change multiple variables in the parent, in case just the return value of the modal isn't enough.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top