To get exact character count as in MS word

2 posts, 0 answers
  1. Saurabh
    Saurabh avatar
    12 posts
    Member since:
    Mar 2012

    Posted 03 Apr 2012 Link to this post

    Hi i am looking for the functionality on the client side for the Editor from which i can get the exact character count of the Characters if its in HTML mode (i.e mode = 2).
    i have used

    var

    oValue = Editor.get_html(true).trim();    ----(a)
    -In this case oValue.length is showing the result which is a count of text entered by user as well as the html tags included.
    also i have tried var oValue = Editor.get_text(true).trim();     ----(b)
    -In this case we are getting the plain text count text count    

    eg: if i enter: B
                    b
    (text is bolded just to distinguish)I shud get count = 3 as we get in MS word if we check. but from (a) and (b) we get diffrent result. This is creating trouble with our QA as we are not getting things approved due to this :(. Can anybody help me on this.
      
    Thanks.

     

  2. Rumen
    Admin
    Rumen avatar
    14351 posts

    Posted 05 Apr 2012 Link to this post

    Hi,

    In HTML mode, RadEditor has another text based content area which works and renders plain text only. You can get reference to it using editor.get_textArea().

    Regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top