Thursday, March 22, 2012

Why the popup cannot return value to parent?

I has a parent and a popup lookup ASP.NET Form. Both has javascript.
I test the popup window's window.Form1.SelectedProductCode.value has a
value. But don't know why the return variable "retvar" has not any value
pass from popup?

-- Parent Windows Script
function DoSelectProductCode()
{ var selectedstr = "";
var retvar;
retvar = window.showModalDialog('ProductSearch.aspx', '',
'dialogWidth:800px:dialogHeight:400px');

window.Form1.txtSearchProductCode.value = retvar;
}

-- Popup windows script
function SelectButtonClicked()
{
window.returnvalue = window.Form1.SelectedProductCode.value;
window.close();
}javascript is case senstive. its window.returnValue;

-- bruce (sqlwork.com)

"ABC" <abc@.abc.com> wrote in message
news:eRIT14y6FHA.3044@.TK2MSFTNGP10.phx.gbl...
>I has a parent and a popup lookup ASP.NET Form. Both has javascript.
> I test the popup window's window.Form1.SelectedProductCode.value has a
> value. But don't know why the return variable "retvar" has not any value
> pass from popup?
>
> -- Parent Windows Script
> function DoSelectProductCode()
> { var selectedstr = "";
> var retvar;
> retvar = window.showModalDialog('ProductSearch.aspx', '',
> 'dialogWidth:800px:dialogHeight:400px');
> window.Form1.txtSearchProductCode.value = retvar;
> }
> -- Popup windows script
> function SelectButtonClicked()
> {
> window.returnvalue = window.Form1.SelectedProductCode.value;
> window.close();
> }

0 comments:

Post a Comment