required and maxlength properties in rich text field

Avatar

Avatar

Kreender

Avatar

Kreender

Kreender

31-03-2016

I' making a component that required a rich text field in the dialog. It is working, but the properties maxlength and required do nothing for this field. I have them configured properly but I can add any number of characters and save the dialog with no text in my rich textfield. I did the component taking as a base the richtextfield in /libs/foundation/components/text component because it has a rich text inside the dialog similar to the one I need.

I've attached an image with my configuration,

I need to make the maxlegth and required properties work

View Entire Topic

Avatar

Avatar

CQ_learner

Avatar

CQ_learner

CQ_learner

01-04-2016

Add a property "validateValue" in your rte field and add this function as the value, This is working for me. Change the length in if condition according to your need.

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