We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to change the background color of the field

Nagesh5
Tera Contributor

Hello Community,

How to change the background color of the field if caller is not empty.

 

Thanks,

Nagesh

1 ACCEPTED SOLUTION

asifnoor
Kilo Patron

Hello Nagesh,

You can use field styles to change color of the field. 

Refer to this link for more information.

https://docs.servicenow.com/bundle/rome-platform-administration/page/administer/navigation-and-ui/ta...

Also, you can write onload client script

function onLoad() { 
  //Type appropriate comment here, and begin script below 
  var element = g_form.getElement('number'); 
  element.style.backgroundColor = "red"; 
}

View solution in original post

1 REPLY 1

asifnoor
Kilo Patron

Hello Nagesh,

You can use field styles to change color of the field. 

Refer to this link for more information.

https://docs.servicenow.com/bundle/rome-platform-administration/page/administer/navigation-and-ui/ta...

Also, you can write onload client script

function onLoad() { 
  //Type appropriate comment here, and begin script below 
  var element = g_form.getElement('number'); 
  element.style.backgroundColor = "red"; 
}