Hi team,
I wanted to add max length character for RTE in touch UI but it is not working.
I think this will be achieved by js .
does any one created js for such type of validation.
Views
Replies
Total Likes
@savi50 Please refer below article for your use-case:
https://sourcedcode.com/blog/aem/touch-ui/aem-richtext-max-characters-length-validation
.
Hi @savi50
Please try this.
//rtemaxvalidation.js
(function($, window, document) { var registry = $(window).adaptTo("foundation-registry"); registry.register("foundation.validation.validator", { selector: "[data-validation=rtemaxlenvalidation]", validate: function(el) { var element = $(el); var maxLen = element.data('maxlength'); var rteLen = element.text().trim().length; if (rteLen > maxLen) { return "Exceeded Maximum Limit"; } } }); }) ($, window, document);
Views
Likes
Replies
Views
Likes
Replies