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

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Append red color asterisk to web resource label

(0) ShareShare
ReportReport
Posted on by 505

Hi Experts,

I have a web resource label.

I need to append red color asterisk to it, to mark it as a required field.

how can I accomplish this?

I have the same question (0)
  • cloflyMao Profile Picture
    25,210 on at
    RE: Append red color asterisk to web resource label

    Hi Priyank,

    Is it working for you?

    Regards,

    Clofly

  • cloflyMao Profile Picture
    25,210 on at
    RE: Append red color asterisk to web resource label

    Hi Priyank,

    You could do it with unsupported way:

    The process is below:

    select web resouce label element by its data attribute -> create a style node -> fill the node with custom CSS rules -> append the tag to the DOM.

    1. Get a data attribute value by inspector:

    pastedimage1587436949525v1.png

    2. Make the label visible

    pastedimage1587437140032v2.png

    3. Execute function below at form OnLoad event.

    function createStyle() {
        var customStyle = '[data-id="WebResource_All_Records-WebResource_All_Records_label"]:after {';
        customStyle  = 'content: "\\002A"; display: inline-block; width: 20px; height: 20px; color: red; text-align: center }';
        var css = document.createElement('style');
        css.type = 'text/css';
        css.innerHTML = customStyle;
        parent.document.head.appendChild(css);
    }

    Result: a red color asterisk has been appended to the label

    pastedimage1587437632668v4.png

    How does it work:

    ::after selector will insert some text after the content of selected element,

    so we created an inline-block element which contains asterisk symbol,

    in HTML, css code for asterisk is "\002A".

    When opening inspector again, we can find an extra element was inserted after label element.

    pastedimage1587437968021v5.png

    At same time, a style node was appended to head tag:

    pastedimage1587438127286v7.png

    Regards,

    Clofly

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Append red color asterisk to web resource label

    Hello,

    You can use something like following:

    *

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 258

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 164

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 121 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans