web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Portal: Can not save records because of Cross-Site Scripting validations

(0) ShareShare
ReportReport
Posted on by 414

Hello everyone,

I am having an issue, the Cross-Site Scripting validations on Portal do not allow me to Update/Save a record.

My records have a description field where the content contains HTML tag </br>, this tag is needed.

Do you have any suggestion ?

Many thanks in advance,

Irena.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Iran

    Can you please replace the description field HTML tag before saving like below -

    var text = descriptiontext.replace(/&/g, "&").replace(/>/g, ">").replace(/</g, "<").replace(/"/g, """);

    And then assign the description text again with above  text.

  • Irena Benja Profile Picture
    414 on at

    Found also:

    function escapeHtml(unsafe) {
        return unsafe
             .replace(/&/g, "&amp;")
             .replace(/</g, "&lt;")
             .replace(/>/g, "&gt;")
             .replace(/"/g, "&quot;")
             .replace(/'/g, "&#039;");
     }
    


    In my case, the field was readonly and assigning text area:

    var text = originalText.replaceAll("<br/>", "");
    would work perfectly!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans