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

Hi Neeraj,



Please have a look at this relevant thread: Issue on Field Style .



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


Hi neerajsharma296,



If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.


If you are viewing this from the community inbox you will not see the correct answer button.   If so, please reviewHow to Mark Answers Correct From Inbox View


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


i have requirement where i am sending some text from client script on to the Description field.

var text= 'Please DO NOT refer to the any attachment';

so here i want only 'DO NOT' to be in red color.

can we achieve that?