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

Actual Characters Count in Editor

1 Answer 91 Views
Editor
This is a migrated thread and some comments may be shown as answers.
parimal
Top achievements
Rank 1
parimal asked on 16 Jul 2008, 11:32 PM
Hi,

How can we get actual charcters count for the text entred by user in RAD Editor. Actual characters meant bu only alphabtes and not the HTML Tags and Atrributes that are generted like <b>, <br>, <UL> etc

regards,

Parimal

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 17 Jul 2008, 07:57 AM
Hi Parimal,

You can achieve the desired behavior with the following code:
<telerik:radeditor runat="server" ID="RadEditor1">  
    <content>  
       <b>Here is sample content!</b>  
    </content>  
</telerik:radeditor>  
<input type="button" value="Count Characters" onclick="CountCharacters()" />  
 
<script type="text/javascript">  
    function CountCharacters()  
    {  
       var editor = $find("<%=RadEditor1.ClientID%>");  
       var oSelElem = editor.get_text();  
       alert(oSelElem.trim().length);  
    }  
</script> 

I hope this helps.

Sincerely,
George
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
parimal
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or