How to make label variable type to look bold in service portal?

Balaram7
Kilo Sage

Hi all,

 

we got a requirement to make label variable type as bold in service portal for a catalog item variable.

I tried this by using a catalog client script. It is working fine in native view. If i open that catalog item request form in service portal, it is showing javascript console error. 

Please help me with the best possible to achieve this.

 

Below is the onload client script i used, its working for Native view but not in Service portal.

 

function onload(){

g_form.getControl('variable_name').setAttributes('style', font weight : bold);

}

  

 

 

Thank you,

Balaram.

1 ACCEPTED SOLUTION

1. Navigate to Service Portal --> Pages

2. Open Page with ID as sc_cat_item

3. In page specific CSS write below. In below example, the backend variable name of my variable is hard_drive

#hard_drive > div > label

{
font-weight:bold;

}

General

#nameofvariable > div > label

{
font-weight:bold;
}

View solution in original post

12 REPLIES 12

1. Navigate to Service Portal --> Pages

2. Open Page with ID as sc_cat_item

3. In page specific CSS write below. In below example, the backend variable name of my variable is hard_drive

#hard_drive > div > label

{
font-weight:bold;

}

General

#nameofvariable > div > label

{
font-weight:bold;
}

Hi Pranesh, 
How to restrict this for one particular catalog item??
if I have same name field in different catalog item, it would affect there right?

I need to make all the variables in one particular item to be bold.

Please provide your input.

Kieran Anson
Kilo Patron

Hi,

getControl isn't available on the service portal. I'd discourage using DOM manipulation and question the requirement. Why is a label needed to be bold? Sounds like help text should be used where the html format can be incorporated in the variable being displayed.

Hi Kieran, 

The requirement is to make the field label as the Header similar to the container. 

But in my project we are not suggested to use Container fields.

 

Thank you,

Balaram.

HI Balaram,

As per your requirement, there are various options available:

  1. Add the variables in a variable set. The label text can be used as the heading of the Variable set.
  2. Add CSS in the instance option, but it will be applicable for all the field labels.