Expand my Community achievements bar.

Maxlength property for richtext - touch UI


Level 2

AEM provides the property "maxlength" for textfield in touch UI but it doesn't work for richtext. Is there any property similar to maxlength for richtext which can perform the same functionality.

2 Replies



The RTE does not support max length and required properties.

Alternatively, you can use allowBlank= false for required and for maxlength you can add a listener (validator) on click of OK button of dialog checking the length of the characters entered in RTE and validate accordingly.


Add a property "validateValue" in your RTE field and add this function as the value, This is working for me. Change the length in if condition according to your need.


var temp=this.getValue();


                                                this.markInvalid("Description should not exceed 500 characters");

                                                return false;



                                                return true;



Note:- RTE in dialog uses the concept of validation from the Form Validation in Granite UI. And, since, Inline-editing does not behave as a form, it can’t use that validation concept.

Kautuk Sahni


Level 2

Hi Kautuksahni,

Thanks for the reply.

I tried using the property "validateValue", with type as "String" and value as the function but it doesn't work.

Please find below the screenshot:


Am I doing it incorrectly or have I missed something here? Is this solution applicable to touch UI?