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
Force.com discussion forumForce.com discussion forum 

how to display rich text field (RTF) data on visaul force page

hi All,

I have rich text field and i want to display the that field data in visaul force page.

i used  <apex:outputText style="font-size:11px;" value="{!descr.Description_Language__c}:" escape="false"/> to display the RTF data but still it is displaying the RTF data on UI like '<span><p> this is desc. </p> </Span>' instead of 'this is desc.'

 

can any one please tell me the resolution , is it possible to do this in visual force/apex or if there are any other workaround which will remove these html tag either by using the java script tag or any other way. 

paul-lmipaul-lmi
try outputField instead of outputText.
Pradeep_NavatarPradeep_Navatar

I have tried your code and used the outputtext to get rich text data on visual force page and it worked fine. If you are unable to resolve this you can handle this via javascript &colon;

 

             <input value="{!description}" id="hidden1"/>

             <span></span>

             <script>

                    document.getElementById('p1').innerHTML = document.getElementById('hidden1').value;

             </script>