- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2022 01:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2022 01:34 AM
Hi,
this script worked for me in portal
1) onLoad catalog client script
function onLoad(){
setTimeout(function(){
var aTags = this.document.getElementsByClassName("ng-binding");
var searchText = "My Label"; // give the text for the label to be searched
var found;
for (var i = 0; i < aTags.length; i++) {
if (aTags[i].textContent.toString() == searchText) {
aTags[i].style.backgroundColor = 'grey';
break;
}
}
}, 3000);
}
Output:
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2022 01:34 AM
Hi,
this script worked for me in portal
1) onLoad catalog client script
function onLoad(){
setTimeout(function(){
var aTags = this.document.getElementsByClassName("ng-binding");
var searchText = "My Label"; // give the text for the label to be searched
var found;
for (var i = 0; i < aTags.length; i++) {
if (aTags[i].textContent.toString() == searchText) {
aTags[i].style.backgroundColor = 'grey';
break;
}
}
}, 3000);
}
Output:
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2022 01:38 AM
Did you get a chance to go through the solution I proposed?
Did my reply answer your question?
If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.
If not, please let us know if you need some more assistance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2022 02:14 AM
Hi
I absolutely cannot recommend the proposed solution via DOM manipulation.
You can also achieve this with pure CSS.
See my example:
For that, you need the value of the "for" attribute of the label tag. Right click on label and then "Inspect" to open the HTML Code inspector of your browser:
Note the attribute value and close the developer tools.
Then hold CTRL-key and right click anywhere on the page. Then click "Instance in Page Editor"
Fill in the following CSS defintion at field CSS
You have to replace the attribute value "sp_formfield_carrier" with your custom value
Kind regards
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2022 10:57 PM
Hi
In case you think I was able to answer your question, I would be happy if you mark the appropriate response as "correct" so that the question will appear as resolved for other users who may have a similar question in the future.
If not, please tell me what you are still missing!
Many thanks & kind regards
Maik