So I have a validation rule, which has a double quote(") in its error message. The location of the error message is at field level.

Suppose for example, the error message is:

You need to enter a valid "Account Name"

This message gets displayed as:

You need to enter a valid "Account Name"

I am aware that, keeping escape= false in pagemessages would display the double quote instead of " in visualforce page.

The problem I am facing is on the field level error messages. Is there anything to display the field level messages with proper double quotes(without escaping)?

  • Is this in a visualforce page where you have inputField? – Boris Bachovski Jun 7 '18 at 6:08
  • yes its in VF page – Hemant Jain Jun 7 '18 at 6:09

This is a known issue. You might need to use single quotes or eliminate the quotes altogether. Alternatively, use pagemessages with escape=false as you already mentioned.

  • Thanks for the helpful information. Was thinking of trying this through javaScript as the last resort, not sure how good practice is that. – Hemant Jain Jun 7 '18 at 6:17
  • 1
    It's definitely an option. If the aim is to provide a better user experience, then go for it. I'd weigh the value vs the effort first though – Boris Bachovski Jun 7 '18 at 6:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.