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
Vikash TiwaryVikash Tiwary 

Rich text area field get renders with its HTML

Hello,
I want to display richtext area field value to be rendered without the HTML tags but i am not able to. I have tried with both of the below lines.
<apex:outputtext value="{!objWorkFeedback.Feedback}" escape="false"/>
<apex:outputfield value="{!objWorkFeedback.Feedback}"/>

I am not sure what the reason could be? Any suggestions or workarounds ?

Thanks is advance

 
Best Answer chosen by Vikash Tiwary
ShaminaShamina
The escape="false" should render the HTML content without the HTML tags

Check if the reference to the field name is correct : {!objWorkFeedback.Feedback} and try to use a more recent API version for the visualforce page

See working sample code below referring to a rich text field on Account:
<apex:page standardController="Account" >
    <apex:outputLabel value="{!account.name}"/> <br/>
    <apex:outputText value="{!account.Rich_text_field__c}" escape="false"/>  <br/>
    
    <apex:outputLabel value="{!account.Rich_text_field__c}" escape="false"/>  <br/>   
    
</apex:page>

 

All Answers

ShaminaShamina
The escape="false" should render the HTML content without the HTML tags

Check if the reference to the field name is correct : {!objWorkFeedback.Feedback} and try to use a more recent API version for the visualforce page

See working sample code below referring to a rich text field on Account:
<apex:page standardController="Account" >
    <apex:outputLabel value="{!account.name}"/> <br/>
    <apex:outputText value="{!account.Rich_text_field__c}" escape="false"/>  <br/>
    
    <apex:outputLabel value="{!account.Rich_text_field__c}" escape="false"/>  <br/>   
    
</apex:page>

 
This was selected as the best answer
SF Buzz VutukuriSF Buzz Vutukuri
it wont be work when we kept in repeat ?