all groups > dotnet jscript > january 2004 >
You're in the

dotnet jscript

group:

I keep getting undefined with showmodaldialog object


I keep getting undefined with showmodaldialog object john_20_28_2000 NO[at]SPAM yahoo.com
1/15/2004 2:14:52 PM
dotnet jscript: Trying to pass an object from a showmodaldialog from the child to the
parent:

I get an alert that says undefined:

var o = new Object();

o.FirstName = document.getElementById("first_name").innerHTML;
window.returnValue = o.FirstName;
window.close();

on the parent:

retval=window.showModalDialog ('searchMNI.aspx?lastname=' + temp);
alert("it is: " + retval.FirstName);

These are from a slightly larger context, but you get the picture from
these snippets.

Re: I keep getting undefined with showmodaldialog object bruce barker
1/15/2004 2:59:01 PM
your script is passing back a reference to a window object, which will not
exist after the window is closed.

try:

var o = new Object();
o.FirstName = document.getElementById("first_name").innerHTML + '';
// want string value, not ref
window.returnValue = o.FirstName;
window.close();


-- bruce (sqlwork.com)


[quoted text, click to view]

AddThis Social Bookmark Button