The CreatorCon Call for Content is officially open! Get started here.

Change color of field Text

Neeraj Sharma10
Tera Guru

Hello experts,

How can we change the color of text in the field?

I tried

var myVar = $('sys_display.' + g_form.getControl('cmdb_ci').id);

myVar.style.setStyle({color: "white"});

but this do not works.!

Thanks in advance

1 ACCEPTED SOLUTION

Hi Amlan Pal



With the help of Client script able to change the color of the text.



var myVar = $('sys_display.' + g_form.getControl('cmdb_ci').id);


myVar.setStyle({color: "white"});



The problem was (.style) which i added out of no where.


Still trying to figure out why on earth i did that.



Thanks for the help


Cheers



Regards


Neeraj Sharma


View solution in original post

13 REPLIES 13

I want to make it on the form ALSo


snehabinani26
Tera Guru

Hi Sneha Binani


Thanks for the reply



I do not want to change the background color of the field, infact what all written inside the field should be of different color (let say everything written inside short description should be red).


Regards


Neeraj Sharma


amlanpal
Kilo Sage

Hi Neeraj,



Please create a new Field Style as of below screenshot. This is working properly in my instance. Please let me know if you find any issue:


find_real_file.png


find_real_file.png



I hope this helps. Please mark correct/helpful based on impact


Hi   Amlan Pal


This Works well when 'value' field is empty as is your case. but when i am giving condition in value this do not work Untitled2.png