Expand my Community achievements bar.

SOLVED

RTE MaxLength

Avatar

Level 4

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 ?

1 Accepted Solution

Avatar

Correct answer by
Level 10

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-manage...

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-manage...

Hope this helps!

~ Ratna.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

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-manage...

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-manage...

Hope this helps!

~ Ratna.