Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

286
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda