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
Nirmal ChristopherNirmal Christopher 

HTMLENCODE is not working

This is the VF code Snippet we are using in our org. The user user rich text area to enter te data and this component is used in a standard page. but we are querying this value in anothe Custom VF page. The problem is the output text value renders the output along with HTML tags. If i remove the HTMLENCODE it works fine. FYI  HTMLENCODE  is required for submitting the app for app exchange. So we cannnot remove that.

<td><apex:outputText value="{!HTMLENCODE(r.questions)}" escape="false"/></td>

Any alternative solutions is appreciated.

Try using:

<td><apex:outputText value="{!HTMLENCODE(r.questions)}" /></td>
Nirmal ChristopherNirmal Christopher
Hi Vinita,
   I tried it not working.

Check logs in developer console. What value are you getting for r.questions?

Also try to replace r.questions with a text field to check if r.questions is causing issue.
Nirmal ChristopherNirmal Christopher
Changed the rich text format to long text area field. But this is not the actual solution.
Hi Nirmal,

Did you find any solution/alternative for this? Actually, we are also facing the same issue with our visualforce page. HTMLENCODE does not seem to be working. Any help will be appreciated.

Thahaseen EThahaseen E
Hi Team,
I am facing the same issue. Do we have any alterate solution for this.
Please suggest if any alternate solution is there?
Thank you,