Javascript in popup does not see the fields on the parent page

0

I have a query in a popup that the result is returned in a gridview. In the gridview I have a button where I call a javascript function that inserts the result by correlating the query return with the main page fields. I'm getting into the function, but when I get to the part that makes the relationship, the error appears:

  

window.opener.document.frm is undefined

The excerpt:

 window.opener.document.frm.txtDS_PES.value = trim(pesnm);

In firebug I have identified that from the frm.txtDES_PES.value it undefined.

<form id="frm" runat="server">
    
asked by anonymous 26.06.2015 / 21:32

1 answer

0

Create a function on your normal (non-popup) page to update values according to ids .

function atualizaValor(id, value)
{
    document.getElementById(id).value = value;
}

And then in your popup just call:

window.opener.atualizaValor('txtDS_PES', trim(pesnm));
    
26.06.2015 / 22:09