The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Catalog variable styles

Eileen Hessmill
Mega Expert

I am trying to make a variable (type = label) bold with this catalog client script code:     g_form.getControl('event_info').style.fontWeight = 'bold';

It is causing a javascript error:  g_form.getControl(...) is null.

I would also like to make the Question value on other variable types bold on some, not all, of the variables in one catalog item.

Is it possible? I'm not having much luck on the community.

1 ACCEPTED SOLUTION

Unfortunately this is NOT supported for the Service Portal, you might need to user the dom manipulation which is not best practice or putting HTML code in the field which will also not work unless you turn off a security property which is definitely not a good idea.

Hope this will clarify your question.

Cheers

Alberto

View solution in original post

4 REPLIES 4

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

try with this script replacing the table and dictionary name field as per your need:

var l = g_form.getLabel('<table_name>.<dictionary_name_of_field>');
l.style.fontWeight='bold'; 

If I have answered your question, please mark my response as correct and/or helpful so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

Cheers
Alberto

Eileen Hessmill
Mega Expert

Hi Alberto,

It looks to be working on the platform, but not the portal. Is that to be expected? Is  there another way for the portal?

Thanks,

Eileen

 

Unfortunately this is NOT supported for the Service Portal, you might need to user the dom manipulation which is not best practice or putting HTML code in the field which will also not work unless you turn off a security property which is definitely not a good idea.

Hope this will clarify your question.

Cheers

Alberto

Eileen Hessmill
Mega Expert

Thank you again. That explains why I couldn't find a suitable solution on the community.