+ Start a Discussion

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.



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 >{! con.test_textarea__c}


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


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





--------------- 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.