Apply colors on Catalog Item variables in Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 10:46 PM
Hello All,
I would like to apply color on the Catalog Item variables in the Service Portal. I have written an onchange catalog client script using below syntax. The below syntax is working in Desktop view, but not in the Service Portal
control.style = "color:red";
In Service Portal, it is showing an error "Javascript console error"
Can someone assist me how to apply to apply colors on the catalog item variables in the Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 10:56 PM
Hi @varunkumar1 ,
please follow the below code:-
var getLblParent= g_form.getElement('label name');
var getLblElement = jQuery("label[for='"+getLblParent+"']").css('color','red');
Also, refer to an example : https://www.servicenow.com/community/itsm-forum/need-to-change-color-of-variable-on-service-portal-b...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 11:36 PM
Hi Sandeep,
Its not working. It is throwing the same Javascript console error in the Portal