- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 05:08 AM - edited 02-12-2024 05:10 AM
I tried adding the following catalog client script, but it changes only the value and not the question.
function onLoad() {
g_form.getControl('new_email').setAttribute('style', 'font-weight: bold');
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 05:24 AM - edited 02-13-2024 05:24 AM
Hey @vidhya_mouli ,
I have it working perfectly fine with the configurations I specified in my answer. Double-check the code and your script configuration. I can see in your code that you don't have the 'label' tag after the variable name in the jQuery. You need to specify 'label' afterward.
// a_variable is the name value for the variable label you want to set to bold.
setTimeout(function() {
// Dont forget to add the "label" attribute after your variable name. My variable name is a_variable and I add a space and label after it. You need to do the same.
this.$('#a_variable label').css('font-weight', 'bold');
}, 200);
Also, make sure:
- You set 'Isolate Script' to FALSE on your Catalog Client Script
- You set the UI Type to Portal or All (Preferably Mobile/Portal)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 06:13 AM
Thank you. Yes, it does work on portal view but not on platform.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 07:36 AM
Hi,
Please refer to this community post - https://www.servicenow.com/community/itsm-forum/how-to-make-label-variable-type-to-look-bold-in-serv...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 09:35 AM
Hi @vidhya_mouli,
You can below code
var l = g_form.getLabel('new_email');
l.style.fontWeight='bold';
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 11:44 PM
getLabel function does not work in catalog client script.