This is a migrated thread and some comments may be shown as answers.

Window as Dialog

1 Answer 61 Views
Window
This is a migrated thread and some comments may be shown as answers.
Stephen Arnold
Top achievements
Rank 1
Stephen Arnold asked on 19 Nov 2010, 11:27 PM
I am using the RadWindow as a dialog functionally it works fine for everything I am doing. There are two more cosmetic things I want to do and I am having trouble with them.

1. I want to set the initial focus to a textbox in the window. I have tried this in a javascript, form tag, and in the page load on the code behind and neither has worked:

javascript:

 

 

var templateName = document.getElementById("txtTemplateName");

 

templateName.focus();


code behind:

txtTemplateName.Focus();

form tag:

 

<

 

 

form id="form1" method="post" runat="server" defaultfocus="txtTemplateName">

 

 

 

 


2. I want to make a button on the window the default button and allow the enter key to press the button. I have set the button as the default button in the form tag and it appears to make it the default, but I press enter and the window clears all input, but it doesn't run the code for the button, then if I reenter the input and click the button with the mouse I get javascript errors.

form tag:

<

 

 

form id="form1" method="post" runat="server" defaultbutton="btnOK" >

 


Thank you in advance for your help.

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 22 Nov 2010, 08:43 AM
Hi Stephen,

What I would suggest is to make sure that your logic works when the content page is displayed in an IFRAME. Once it does, load it in a RadWindow with ShowContentDuringLoad=true and you should get the same behavior there as well.

Kind regards,
Georgi Tunev
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Window
Asked by
Stephen Arnold
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or