Accessing a element of parent window in child window
by
Hi,
Below is a function in my aspx page called Parent.aspx.I'm calling it on click event of a button on this page.
function fnParentFrmSubmit()
{
document.body.insertAdjacentHTML("beforebegin","<input type=text id='txtBox' value='Y'>");
document.Form1.submit();
}
...And the below function is in another page called Child.aspx which I'm calling on Page_Load event
function fnChildWinLoad()
{
alert(window.opener.document.forms[0].txtBox.value) }
When the user clicks on the submit button,I am submitting the form thru' client side javascript and then in the code behind
of this page,I am opening a Child.aspx using Response.write("<script language='javascript'>window.open(Child.aspx,'abcd')")
I am creating a textbox element dynamically and then trying to access its value in the child element.
But I am getting javascript error 'window.opener.document.forms[0].txtBox.value' is not an object or is null.
I tried using window.opener.document.getElementById("txtBox").value,but still I get the same javascript error.