function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DrawloopSupportDrawloopSupport 

InputTextArea: Disabled with RichText does not disable the text area

Has anyone else tried to disable a rich text area using the apex:inputTextArea tag?

 

 

<apex:inputTextarea richText="true" disabled="true" />

Thanks!

 

blombardisblombardis

Hi,

I tried it and couldn't disable a rich textarea.

I believe since it is a WYSWYG it uses javascrypt and that attribute is override.

If you post why you can do this mayb eI can help you finding out another solution.

 

Good luck,

Bruno

DrawloopSupportDrawloopSupport

We used a work around with JavaScript. It would be nice if Salesforce could take care of this so that it is simpler for developers to disable the rich text tool. 

bdstangbdstang

Could you share the javascript work around?  I have a similar problem & can't find another way to get a Richtext field disabled.

DrawloopSupportDrawloopSupport

No guarantees on this code:

 

 

function disableRichText() {
    a = '[id$=:richTextArea___Frame]';
    a = jQuery(jQuery(a).get(0).contentDocument);
    a.find('#xToolbar').hide();
    a = a.find('iframe').get(0);
    if (a)
    {
        jQuery(a.contentDocument).find('body').append('<div style="position: fixed; width: 100%; height: 100%; top: 0; left: 0; opacity: 0.1; background-color: #000;"></div>');
        jQuery(a).css('height', '100%');
    }
}

 

 

You'll also need this directly after the inputTextarea:

 

 

<script>
    var intvl = setInterval(function() {
        if (window.FCKeditorAPI)
        {
            disableRichText();
            clearInterval(intvl);
        }
    }, 200);
</script>

 

If you have jQuery questions, please visit their site: http://docs.jquery.com/Main_Page