Skip to main content

Notifications

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

  • Irena Benja Profile Picture
    414 on at
    RE: Portal: Can not save records because of Cross-Site Scripting validations

    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!
  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Portal: Can not save records because of Cross-Site Scripting validations

    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.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans