Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how to make the choices red and green in a select box variable

Nihar2
Tera Contributor

I a select box there are 2 variables ie: red, green

 

choice: red - should have the background color red

choice: green- should have the background color green

 

I attach the picture of that variable. Please help me to do this.

8 REPLIES 8

Hi @Aman Kumar S ,

Yes, you are correct getControl doesn't work in service portal.

If you know the proper code please let me know.

Nihar2
Tera Contributor

g_form.getControl('testcolor').style.backgroundColor='green';

 

It is not working in service portal.

Nihar2
Tera Contributor

How its work in portal?

Jerick I
Kilo Sage

Hi @Nihar2,

 

Kindly check out this community post Background Color on a choice list.