Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
570
focus in textbox inside webdialogwindow
posted
 var webDialogWindow = $find('<%= wdwProjet.ClientID %>');

webDialogWindow.set_windowState($IG.DialogWindowState.Normal);

var iframe = webDialogWindow.get_contentPane().get_iframe().contentWindow.igedit_getById("textbox1").focus();

 I got error in the line webDialogWindow.get_contentPane().get_iframe()  tell the value is null

 i see on other post this code work fine :(

for information im in usercontrol.

 

Parents
  • 28464
    posted

    Yes - the reason for that is that WebDialogWindow has two modes - external page and Template mode. The code above will work for external page, while for Template modeyou will need something similar to this:

    <cc1:WebDialogWindow ID="WebDialogWindow1" runat="server" Height="300px"
            Width="400px">
            <ContentPane>
                <Template>
                    <asp:TextBox runat="server" ID="TextBox1" />
                    <input type="button" onclick="focusOnTextBox()" value="focus" />
                   
                    <script language="javascript">

                        function focusOnTextBox() {
                            document.getElementById("<%= TextBox1.ClientID %>").focus();
                        }
                   
                    </script>
               
                </Template>
            </ContentPane>
        </cc1:WebDialogWindow>
           

    HTH,

Reply Children
No Data