Goa_Koala
asked on
Getting the parent of the base page that opens a ModelDialog
Hi;
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.dialogArgume nts.
To make things clear here is an example code. If i was using window.open 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.docume nt.all.tag s( "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...
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.dialogArgume
To make things clear here is an example code. If i was using window.open instead of showModalDialog than my code would look like this.
function someFunction()
{
valueIWantToGet = opener.parent.document.all
}
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.docume
//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...
I really don't think that's possible.
ASKER
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
window.dialogArguments.top or window.dialogArguments.par ent works just fine. :)
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
window.dialogArguments.top
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.