Add color to target picklist is a very simple task. I will show you an example on Task form, Priority Picklist.
It has three options: Low, Normal, High.
Let’s add colors for them: Yellow, Green and Red.
Simply add OnLoad event:
function AddColorToPriority()
{
crmForm.all["prioritycode"][0].style.background = "#FFF380"; // Low => Yellow
crmForm.all["prioritycode"][1].style.background = "#5EFB6E"; // Normal => Green
crmForm.all["prioritycode"][2].style.background = "#E55451"; // High => Red
}
It has three options: Low, Normal, High.
Let’s add colors for them: Yellow, Green and Red.
Simply add OnLoad event:
function AddColorToPriority()
{
crmForm.all["prioritycode"][0].style.background = "#FFF380"; // Low => Yellow
crmForm.all["prioritycode"][1].style.background = "#5EFB6E"; // Normal => Green
crmForm.all["prioritycode"][2].style.background = "#E55451"; // High => Red
}
Here is
other way to implement it:
function AddColorToPrioritySecond()
{
crmForm.all.prioritycode[0].style.background = "yellow"; // Low => Yellow
crmForm.all.prioritycode[1].style.background = "green"; // Normal => Green
crmForm.all.prioritycode[2].style.background = "red"; // High => Red
}
{
crmForm.all.prioritycode[0].style.background = "yellow"; // Low => Yellow
crmForm.all.prioritycode[1].style.background = "green"; // Normal => Green
crmForm.all.prioritycode[2].style.background = "red"; // High => Red
}