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

Notifications

Announcements

No record found.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans