Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

291
Views
How to set a character limit for the raw data output in ckeditor 5

I have a max length that I need editor.getData().length to be before I send it to my server. I have the word Count plugin working I just need to add some code to achieve this in the on update method. I want the editor to behave as an html input tag would behave with the "maxlength" attribute set, so it would disable any further typing when the dataCount reaches the specified limit(5000).

ClassicEditor
    .create( document.querySelector( '#editor' ),{
        
    })
    .then( editor => {      
        editor.plugins.get( 'WordCount' ).on( 'update', ( evt, stats ) => {
            const limit = 5000;
            const dataCount = editor.getData().length;
            //disable typing when dataCount >= limit
            //what code do I put here?   
        } );                                
    } )             
    .catch( error => {
        console.error( 'Oops, something went wrong!' );             
        console.error( error );
    } );
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!