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.
What am I doing wrong? Thanks.
bruce barker - 15 Jan 2004 22:59 GMT
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)
> Trying to pass an object from a showmodaldialog from the child to the
> parent:
[quoted text clipped - 16 lines]
>
> What am I doing wrong? Thanks.