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
streetstreet 

Problem with rich text on visual force page.

I have a field(Text area) in a object, when im entering the text about 400 lines as paragraphs, after displaying the same on visual force page its displaying as breaks tags on page. 

 

so any solution for it to remove breaks tags on visual force page.

Navatar_DbSupNavatar_DbSup

Hi,

One way is that you can set the attribute escape=”false” of the <apex:outputlabel> tag. For displaying the output of the html tag.

 

Another way is put you merge field in the html <pre></pre> tag.

 

Try the below code as reference:

--------  Vf page------------

<apex:page controller="textareadisplay">

   <Apex:outputLabel >text area

  </Apex:outputLabel>

   <Apex:outputLabel >{! con.test_textarea__c}

  </Apex:outputLabel>

   <Apex:outputLabel ><b>text area long </b>

  </Apex:outputLabel>

   <Apex:outputLabel ><pre>{!con.test_Text_Area_Long__c}</pre>

  </Apex:outputLabel>

 

</apex:page>

 

--------------- Apex Controller -------------

 

public class textareadisplay

{

public contact con{get;set;}

public textareadisplay ()

{

    con=[Select c.test_textarea__c, c.test_Text_Area_Long__c From Contact c where id ='0039000000C37mx'];

}

}

 

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.