Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: retrieving parent fields from child (showModelDialog)


Message #1 by "pramod parnati" <ppkumar90@h...> on Fri, 20 Dec 2002 17:59:15
A modal dialog in MSIE does not have a value assigned to the "opener" 
property.

However, you can get the opener if you pass window.self as the second 
parameter (dialogArguments) in the showModalDialog method in the parent 
page:

     result=showModalDialog('mychild.html',window.self,...);

and in the child page, you can either reference the dialogArguments 
directly or you can assign it to the window.opener property and then use 
it as you normally would:

     window.opener=window.dialogArguments;

I recently ran into this problem myself and folks on this forum helped me 
solve it!

:)

-Van

> Hi 
i>  am trying to retrieve the parent fields from child

> the code below is not working

> function setParentFlag(){

> var sourceList=window.document.forms[0].storeArrGrpAssg;
	> if(sourceList.length==0){
 >       window.opener.itemDetailForm.storeGroupAssigned.value="No";
 >    }else{
 >    window.opener.itemDetailForm.storeGroupAssigned.value="Yes";
 >    }

> //this code is also not working
 >    if(sourceList.length==0){
w> indow.parent.document.itemDetailForm.storeGroupAssigned.value="No";
 >    }else {
w> indow.parent.document.itemDetailForm.storeGroupAssigned.value="Yes";
 >    } 

  Return to Index