How to make variable bold and blue in color in catalog item
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2023 03:21 AM
Hi Developers.,
I have written below onload script but it is unsuccessful, please help me
First method:
var el = g_form.getControl('project_name');
el.style.color = 'red';
el.style.fontWeight = 'bold';
2nd method
var l = g_form.getLabel('ns_new_laptop_msg');
l.style.fontWeight='bold';
l.style.color= 'blue';
Please do specify any other methods.
Regards,
Gayathri
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2023 03:30 AM
Hi @Gayathri5,
Take a look at this article: Field Styles for Service Catalog Variables
It will help you to apply field styles for catalog item variables.
If my response helps you resolve your issue. Kindly mark it as helpful & correct. It will be helpful to future readers! 👍🏻
Thanks,
Sagar Pagar
The world works with ServiceNow
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2023 04:03 AM
Hi @Gayathri5
try DOM in onload while check isolated script as false
function onLoad() {
var el = document.getElementById("label_IO:058232e197243110c6257076f053af02"); // get label id of your field by inspect the form
el.style.color = 'blue';
}