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?
(I guess this is a fairly easy question, and I'm sure I could google it, but to get the Salesforce community going on here I figure we need a few easy questions.)
edit: (Bounty added to try and generate some excitement)
Try this:
<apex:outputField value="{!case.Description}"/>
Using output fields will maintain formatting automagically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With