Change color of each choices in a choice field dropdown

divyavashishtha
Tera Contributor

How can i change color of each choices in my choice field dropdown.   eg.,

find_real_file.png

Thanks in advance!

5 REPLIES 5

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Pradeep,


Thanks for the response. but its not working.


Harsh Vardhan
Giga Patron

Community Alums
Not applicable

Hi,

Please find the below script to change the choice option background and foreground colors:

Syntax: g_form.getOption("fieldname", "option_value").style.color = "color value";

 

Example:

g_form.getOption("colors", "red").style.backgroundColor = "yellow";
g_form.getOption("colors", "red").style.color = "red";

 

Thanks,

Ravinder