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

[Solved] How do I set cursor to End of Document?

2 Answers 120 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Denny Upadhyaya
Top achievements
Rank 1
Denny Upadhyaya asked on 20 Feb 2008, 09:36 AM
How do I set the cursor to the end of the document after I've loaded with editor.set_Html()?


2 Answers, 1 is accepted

Sort by
0
Accepted
George
Telerik team
answered on 20 Feb 2008, 11:15 AM
Hi Denny,

Here is an example code which positions the cursor on the line after the set text.

<telerik:RadEditor ID="RadEditor1" runat="server">                  
</telerik:RadEditor> 
<input type="button" value="SetContent" onclick="ResetContent()" /> 
<script type="text/javascript">  
function ResetContent()  
{  
    var editor = $find("<%=RadEditor1.ClientID%>"); //get a reference to RadEditor client object  
    editor.setFocus();  
    editor.set_Html("Some content<br />Some content<br />Some content<br />");
}  
</script>  


I hope this helps.

Best regards,
George
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Denny Upadhyaya
Top achievements
Rank 1
answered on 20 Feb 2008, 11:34 AM
Thanks George,

That worked great!

Tags
Editor
Asked by
Denny Upadhyaya
Top achievements
Rank 1
Answers by
George
Telerik team
Denny Upadhyaya
Top achievements
Rank 1
Share this question
or