[CLOSED] set TextField's value between 2 browsers
I have a page, ex main.aspx, open a child window , and child return some value. The code of main.aspx are following :
Code:
<ext:TextField runat="server" ID="tfFac" X="0" Y="140" ClientIDMode="Static"></ext:TextField>
<ext:Button ID="btnGetFac" runat="server" Text="Plant" IconAlign="Left" Icon="BookOpen" X="255" Y="10">
<Listeners>
<Click Handler="window.open('GetFac.aspx', '_blank', 'toolbar=no, location=yes, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=400, height=500');" />
</Listeners>
</ext:Button>
In the child window, GetFac.aspx, need to set a textfield's value in parent window, the code are :
Code:
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script type="text/javascript">
function sendBack()
{
window.opener.document.getElementById("tfFac").Value = document.getElementById("TextBox1").value;
}
</script>
</head>
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
TextBox1.Text = GridView1.SelectedRow.Cells[2].Text.ToString();
if (!Page.ClientScript.IsStartupScriptRegistered("toParent"))
{
Page.ClientScript.RegisterStartupScript
(this.GetType(), "toParent", "sendBack();", true);
}
}
It can't work. I guess the problem is the part of
Code:
window.opener.document.getElementById("tfFac").Value
What is the correct code ?