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

[Solved] SetFocus on validation

1 Answer 97 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Kashif Imran
Top achievements
Rank 1
Kashif Imran asked on 13 Aug 2009, 11:14 PM
I have three rad ajax text editors on a page. When user enters text I need to do some validation and based on that I need to set focus to one of the boxes. How can I do that?

I tried txt1.Focus(); but it does not work.

Also how can I limit number of words (not characters). I would appreciate any sample code. Thanks,

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 14 Aug 2009, 08:29 AM
Hi Kashif Imran,

You can see how to get reference to RadEditor in this help article: Getting a reference to RadEditor. After that you can set the focus on the editor using the setFocus method, e.g.

var txt1 = $find("<%=RadEditor1.ClientID%>"); //get a reference to RadEditor client object
txt1.setFocus();

Please find attached an example demonstrating how to limit the content in multiple RadEditors.

All the best,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Kashif Imran
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or