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
Girbson Bijou 8Girbson Bijou 8 

Rich text Area field in Visualforce page

Hi all, Help me please. 
I want display a field value of a Rich text area in a Visualforce as it is formated in the layout. The must important for me is to go on the next line like in the first screenshot. 
Here is my portion of code

<p style="border: 0.08px solid black;"> {!Container__c.General_Comments__c}</p>
User-added image
Best Answer chosen by Girbson Bijou 8
Priyananth RPriyananth R
Hi Girbson,

Just try below code instead of yours,

<apex:outputText escape="false" value="{!Container__c.General_Comments__c}" ></apex:outputText>

Thanks,

All Answers

Priyananth RPriyananth R
Hi Girbson,

Just try below code instead of yours,

<apex:outputText escape="false" value="{!Container__c.General_Comments__c}" ></apex:outputText>

Thanks,
This was selected as the best answer
Madhukar_HeptarcMadhukar_Heptarc
Hi Girbson,

Can please try below format it may help you.
 
Visualforce Page:
==============
<apex:page controller="xyz">
    <apex:form>
        <apex:pageBlock > 
            <apex:pageBlockSection columns="1">
                <apex:outputField Value="{!con[0].name}"></apex:outputField>
                <apex:outputField Value="{!con[0].Submit_Discription__c}"></apex:outputField>
                <apex:inputTextarea value="{!con[0].Submit_Discription__c}" richText="True"/> 
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Apex:class:
========
public class xyz 
{
    public List<Dist__c> con{get;set;}
    
    {
        Id conId = 'a080o00002lfNeI'; // Here, I have taken hardcoded Id But you can Replace ConId from URL. 
        con = [SELECT id,name,Submit_Discription__c from Dist__c WHERE Id=: conId limit 1];
        system.debug('Dist Data :'+con[0].name);
    }
}
<apex:inputTextarea value="{!con[0].Submit_Discription__c}" richText="True"/>  
Please look at the below screen shot for output of VF.
DisplayRichText

Please let me know if it useful / if you need Any help  
Thanks & Regards
Madhukar_Heptarc
Madhukar_HeptarcMadhukar_Heptarc
If your are trying to display as a inputtext area field please try below code.

<apex:page standardController="Container__c">
    <apex:form >
        <apex:pageBlock > 
            <apex:pageBlockSection columns="1">            
                <apex:inputTextarea value="{!Container__c.General_Comments__c}" richText="True"/> 
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Mention richText="True" 
User-added image

Please let me know if any help required.