Expand my Community achievements bar.

AEM RichText Max Characters Length Validation | AEM Community Blog Seeding

Avatar

Administrator

BlogImage.jpg

AEM RichText Max Characters Length Validation by sourcedcode

Abstract

In this article, we will take a look at how we can add max character length validation to the richtext component, cq/gui/components/authoring/dialog/richtext, by introducing a maxlength attribute. The validation will be executed whenever AEM authors try to save or perform an on-key-up action after applying changes within the richtext input field. After implementing the solution, all richtext components within the installed AEM author environment will have this feature enabled.

// to enable the max character limit, simply include the "maxlength" attribute

...


We will be solving this problem by registering a new validator (foundation.validation.validator) to the foundation-registry (the foundation-registry is used in the Granite UI framework). In this solution we will be utilising the jQuery Validation library (the validation library used by Granite UI is achieved by using jQuery Validation plugin). A new client library will be introduced to inject JavaScript into our context page, and to execute the registry and scripts.

Read Full Blog

AEM RichText Max Characters Length Validation

Q&A

Please use this thread to ask the related questions.



Kautuk Sahni
Topics

Topics help categorize Community content and increase your ability to discover relevant content.

0 Replies