I want to set the color of text in short description field and choice list field.

ganeshexpert
Kilo Contributor

Hi,

I want to set the color of text in short description field and choice list field.,

I have trid below code but its not working.

var shortdescriptionField = $('sys_display.task.short_description');

shortdescriptionField.setStyle({color: "red"});

3 REPLIES 3

neetusingh
Giga Guru

Can you try this -


    g_form.getControl('field_name').style.backgroundColor = 'blue'; //Set the background color of a field


    g_form.getControl('field_name').style.color = 'white'; //Set the text color of a field


    g_form.getControl('field_name').style.fontWeight = 'bold'; //Set the text font to bold


RKumar3
Tera Guru

Hi Ganesh, You can do this using a field style for Incident table field Short Description as given below.



Table : Incident


Field Name : Short Description


Value : Leave Blank Style : color:Red



I am assuming that you want to set the color of text in short description field. If you want to set the background color use "background-color:Red".



Rajnish


darshanr
Kilo Guru

Hi Ganesh,



Field Style is the best solution as mentioned by RKumar if if is String field without choice as background color is not applicable for choice fields on form though it is visible in List Layout.