You need to sign in to do that
Don't have an account?
dmcheng
outputField, long textarea field and unwanted spaces
I am having trouble with apex:outputField and a long textarea field. Salesforce appears to be inserting extra spaces on lines after BR tags.
Here is the text exactly as it appears within the long textarea field:
Note all lines are flush against the left margin.
Here is resulting HTML after apex:outputField:
Note that all the text lines after BR tags are indented by a space. This causes problems because we are also using Markdown to do some extra formatting.
Anyone know how I can eliminate those extra spaces? I've already tried outputText but that does not suit our needs.
Thanks
David
Here is the text exactly as it appears within the long textarea field:
The following questions and requirements are needed to continue your on-boarding. Once you have finished, you will have access to our system for client and resource management. 1. Fill in some demographic information 2. Sign the advocate handbook If you have any questions, please contact your Program Manager. Welcome to the team!
Note all lines are flush against the left margin.
Here is resulting HTML after apex:outputField:
<span> The following questions and requirements are needed to continue your on-boarding. Once you have finished, you will have access to our system for client and resource management. <br> <br> 1. Fill in some demographic information <br> 2. Sign the advocate handbook <br> <br> If you have any questions, please contact your Program Manager. <br> <br> Welcome to the team! </span>
Note that all the text lines after BR tags are indented by a space. This causes problems because we are also using Markdown to do some extra formatting.
Anyone know how I can eliminate those extra spaces? I've already tried outputText but that does not suit our needs.
Thanks
David
You can take the value in a string and show it using output test after removing html characters by string replace method
for example you can replace <br> by space etc.