[CLOSED] set TextField's value between 2 browsers

  1. #1

    [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 :
    <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 :
    <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
     window.opener.document.getElementById("tfFac").Value
    What is the correct code ?
    Last edited by Daniil; Sep 25, 2013 at 5:24 AM. Reason: [CLOSED]
  2. #2
    Hi @gs_user,

    Please use:
    window.opener.App.tfFac.setValue("Hello!");
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @gs_user,

    Please use:
    window.opener.App.tfFac.setValue("Hello!");
    Hi, Daniil

    it works, thanks.

    BTW, if I the TextField id is dynamic, how can change the code ?
  4. #4
    Maybe, this suites your needs.
    window.opener.App["textFieldId"].setValue("Hello!");

Similar Threads

  1. [CLOSED] Inconsistencies in browsers
    By PriceRightHTML5team in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Jul 16, 2013, 5:37 AM
  2. [CLOSED] KeyMap and browsers events
    By jdacosta in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 04, 2013, 1:42 PM
  3. [CLOSED] Issue with modal window (all browsers)
    By bogc in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jun 20, 2013, 2:18 AM
  4. INSERT KeyMap (all browsers)
    By David Pelaez in forum 1.x Help
    Replies: 1
    Last Post: Jan 25, 2011, 2:36 PM
  5. [CLOSED] Hidden tab in IE7, but visible in other browsers
    By juanpablo.belli@huddle.com.ar in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Mar 18, 2009, 1:32 PM

Posting Permissions