How to make a question text bold in a service catalog

vidhya_mouli
Giga Sage

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');
}

 

1 ACCEPTED SOLUTION

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:

  1. You set 'Isolate Script' to FALSE on your Catalog Client Script
  2. You set the UI Type to Portal or All (Preferably Mobile/Portal)

EthanDavies_1-1707830316261.png

 

EthanDavies_0-1707830256276.png

 

View solution in original post

13 REPLIES 13

Thank you. Yes, it does work on portal view but not on platform.

swathisarang98
Giga Sage
Giga Sage

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

 

getLabel function does not work in catalog client script.