Maxlength Is nor working in RTE for touch UI | Community
Skip to main content
Level 2
November 29, 2021

Maxlength Is nor working in RTE for touch UI

  • November 29, 2021
  • 3 replies
  • 1109 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

Bhuwan_B
Community Advisor
Community Advisor
November 29, 2021
savi50Author
Level 2
November 29, 2021

Hi @bhuwan_b ,

                            I already tried but it is not working

Level 2
November 29, 2021

.

Kishore_Kumar_
Level 9
November 29, 2021

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);