0 votes
1 view
in Salesforce by (11.9k points)

In Salesforce, if I'm binding a text field into a VisualForce page, whats a good way to convert the carriage returns in the text-field into HTML <br/> tags?

e.g. starting from something like this:

<apex:page standardController="Case">

  <apex:pageBlock title="Test">

      <p>{!case.Description}</p>

  </apex:pageBlock>                   

  <apex:detail relatedList="false" />

</apex:page>   

... if the Description is long with lots of carriage returns, how do I HTML-ify it?

1 Answer

0 votes
by (31.8k points)
edited by

Try using this:

<apex:outputField value="{!case.Description}"/>

Using output fields will support formatting automagically.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...