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
SidharthSidharth 

inputTextArea formatting lost, when value pulled from controller

Hello All

 

I have a long text area field, which i have to pull into VF page in a apex:inputTextArea with richText=true (through a controller).

But all the formatting is getting lost in the vf page.

 

Ex: If long text area field value is: 

msg1

msg2

 

in apex:inputTextArea with richText=true, its showing as plain text msg1msg2 (without line breaks)

 

How can i retain the formatting ?

 

Thanks

Sid

Sdfc devSdfc dev

Hi,

 

String inputContent = // Get the content from the inputTextArea

 

Then,

 

String formatContent = inputContent.replaceAll('<br>','/n');

 

Now, you get the content with line breaks.