RTE MaxLength | Community
Skip to main content
vijayk87714775
New Participant
April 4, 2017
Solved

RTE MaxLength

  • April 4, 2017
  • 1 reply
  • 983 views

can we set max length for text RTE.??
I did found few solutions online stating that we can adding property directly as

function(field){
var temp=this.getValue();
                                if(temp.length>500){
                                                this.markInvalid("Description should not exceed 500 characters");
                                                return false;
                                }else{
                                                this.clearInvalid();
                                                return true;
                                }
}

 (or) 

by  creating a custom listener.?

which is the best approach ?

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

Hi Vijay,

Yes, the listener which you got will work for Classic UI. You can directly include as a property in the dialog node.

I hope you got the solution from this thread: http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__bsam-i_making_a_component.html

However for Touch UI, I think you need to write the script(Listener) in separate JS file to validate the same. 

See this community article for a reference in Touch UI

//http://adobeaemclub.com/aem-touch-ui-dialog-validation/

Also see this recent thread that describes the same use case: http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__iz30-i_am_using_theinpl.html

Hope this helps!

~ Ratna.

1 reply

Ratna_Kumar
Ratna_KumarAccepted solution
New Participant
April 4, 2017

Hi Vijay,

Yes, the listener which you got will work for Classic UI. You can directly include as a property in the dialog node.

I hope you got the solution from this thread: http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__bsam-i_making_a_component.html

However for Touch UI, I think you need to write the script(Listener) in separate JS file to validate the same. 

See this community article for a reference in Touch UI

//http://adobeaemclub.com/aem-touch-ui-dialog-validation/

Also see this recent thread that describes the same use case: http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__iz30-i_am_using_theinpl.html

Hope this helps!

~ Ratna.