Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Need to change text color of catalog's variable in portal

rah dev
Tera Contributor

I am working on a ServiceNow Service Portal widget where the default "This field is mandatory" message is appearing in grey.

I have already implemented a client script to display the message as an error (red color), but it seems that the portal’s backend CSS is overriding my changes.

Issue:

t.png

 


Despite setting the error state in the client script, the mandatory field message still appears in grey instead of red.

What I need help with:

How can I override the Service Portal CSS so that the mandatory error message is displayed in red?

thanks

2 REPLIES 2

Naveen20
ServiceNow Employee

Can you try this

Wrap your widget into a unique class and use it as a prefix — that raises specificity naturally:
html<!--
<div class="cl-mandatory-fix">
<!-- your form here -->
</div>
css.cl-mandatory-fix .help-block {
color: #d32f2f;
font-style: normal;
}

rah dev
Tera Contributor

Hi @Naveen20, thanks for the response, actually it is record producer's variable where help text is showing black text i need to fix it, even though i tried fieldmsg function as error,info etc, but it is changing the background color not text color so i need to fix it.
Thanks