- 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-12-2024 05:31 AM
Hi,
please use below code.
function onLoad() {
var questionElement = g_form.getControl('hardware_type');
if (questionElement) {
questionElement.style.fontWeight = 'bold';
}
}
if it is helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 06:17 AM
HI @vidhya_mouli ,
Please use the script mentioned in the article :https://www.servicenow.com/community/developer-articles/how-do-i-set-short-description-field-your-la...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 06:23 AM
I am trying to do this in portal and it does not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 06:58 AM
Try this code in your onLoad Client Script. You will need to set the Isolate Script attribute to False on your Client Script.
// a_variable is the name value for the variable label you want to set to bold.
setTimeout(function() {
this.$('#a_variable label').css('font-weight', 'bold');
}, 200);