Click to See Complete Forum and Search --> : retrieving values from a closing modal dialog


karlmcauley
06-09-2004, 11:19 AM
Hello,

i have a page which loads a modaldialog page if a users clicks a specific button.

If this modal dialog page is fired up i run mini jscript functions which return true or false depending on what the criteria dictates....eg.

function validateStatus()
{
continue_on = window.confirm("The selected account type has no matching value in t_account_type_defaults. Click OK to Reselect or Cancel to Abort");
if(continue_on)
{
top.document.show_account_types.accounttype.focus();
return false;
}
else
{ top.window.close();
return true;
}
}

If the window closes how do i send a value back to the main page with the window.close() method??

I am trying:
//open pop up window passing account ref to pop up page
width = 500;
height = 200;
options = "dialogWidth=" + width + "px;"
options += "dialogHeight=" + height + "px;"
options += "center=yes;help=no;status=no;resizeable=no";
title = "AccountTypeDetails";
url="AccountTypeDetails.asp?AccountNoRef=" + AccountNoRef + " ";

rv = window.showModalDialog(url, title, options);

alert(rv);
But i keep getting an alert message with undefined in it!!!!!!
Do i have to pass another value back to this page and NOT simply true or false??

Any help would be much appreciated.

Cheers