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

rad editor setfocus doesn't work in chrome

1 Answer 110 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
priya nallaperumal
Top achievements
Rank 1
priya nallaperumal asked on 22 Nov 2010, 06:14 AM
hello!

i am using radeditor control. i just given setfocus in js while clicking the button.
it works in ie but it doen't works in chrome.
function setfocus()
{
var edt1=$find("<%=txtmessage.ClientID%>");
//alert(edt1);
edt1.setFocus();
var edt1=$find("<%=txtmessage.ClientID%>");
edt1.setFocus();
var val=$find("<%=RadEditor1.ClientID%>");
val.setFocus();
}

<asp:button id="send_btn" runat="server" OnClientClick="setfocus()"/>

thanks.
priya.
 function setfocus()
{
//alert("fun");

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 24 Nov 2010, 02:24 PM
Hi Priya,

The server button performs postback and the focus is lost. You should cancel the postback using return false as shown below:

Copy Code
<script type="text/javascript">
    function setfocus() {
        var edt1 = $find("<%=RadEditor1.ClientID%>");
        edt1.setFocus();
    }
</script>
<telerik:RadEditor ID="RadEditor1" runat="server">
</telerik:RadEditor>
<asp:button id="send_btn" Text="Set Focus" runat="server" OnClientClick="setfocus();return false;"/>


Sincerely yours,
Rumen
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
General Discussions
Asked by
priya nallaperumal
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or