Counting characters in the text area

Last post 08-28-2007, 1:17 PM by gzangirolami. 5 replies.
Sort Posts: Previous Next
  •  08-27-2007, 5:32 PM 32967

    Counting characters in the text area

    I am looking for a way to count the characters in the editor and then display the count so that the user knows how many characters they have remaining for their message.  I have done this in the past in a text area using OnKeyDown and OnKeyUo functions and then a read only input text box to display the remaining characters.  However it appears that this editor does not recognize this script.  Thank you
    Brumby
  •  08-27-2007, 5:50 PM 32971 in reply to 32967

    Re: Counting characters in the text area

    I am running into the same issue as of right now. I found that cute editor generates its own "textarea" using javascript so its hard to know where to tie in the script. I'll let you know of any success.
  •  08-27-2007, 11:45 PM 32974 in reply to 32971

    Re: Counting characters in the text area

    Well at least I know I am not crazy.  I have also asked for some input from support at CuteSoft.  We shall  see.
    The first reply I got was to use CuteEditor_OnChange event and to look at the javascript API and modify code as I needed.  However, it seems to be beyond my pay grade.  I am a self taught "programmer" and I will have to continue to apply my will to this one I guess.
    Best
  •  08-28-2007, 9:43 AM 32984 in reply to 32974

    Re: Counting characters in the text area

    At least now I know there is a OnChange Event. Hmm...This may help.
  •  08-28-2007, 10:43 AM 32989 in reply to 32984

    Re: Counting characters in the text area

    In the bottom of your page, post the following script:
     


      <script>

      function CuteEditor_OnChange(editor)
      { 
       // get the cute editor instance
       var editor1 = document.getElementById('<%=editor.ClientID%>');
        
       // Get the editor HTML
       var len=(editor1.getHTML()).length;
        
       //when the content be changed..
       alert(len);
      }
      
      </script>


    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  08-28-2007, 1:17 PM 32999 in reply to 32989

    Re: Counting characters in the text area

    Thanks Adam. This helps a bunch.
View as RSS news feed in XML