2

I have a opener window that is currently using showModalDialog. This needs to be replaced because its deprecated. The modal dialog window has a window.returnvalue. As a result, I am unable to simply use Window.Open to replace showModalDialog.

Is there anyway to work around this problem? Below is a sample code Caller:

retval = window.showModalDialog('abc.asp?user=' SomeUser + "center=no;dialogwidth:600px;dialogheight:400px;dialogwidth:600px;dialogheight:400px;help=No;status=yes")
//DO SOMETHING WITH retval

Modal Dialog Window:

  <script>
  function SaveMe()
  {
      window.returnValue = 'Some value that is needed in caller';
      window.close();
  }

amindomeniko
  • 417
  • 6
  • 23

1 Answers1

1

You can try windows.open().

Call popup:

retval = window.open(......);
//bind close event to retval
retval.onunload = getReturnValue;

And function getReturnValue

function getReturnValue(){
//now value is retval.returnValue or something you bind
console.log(retval.returnValue);
}

I just fixed my website yesterday.