Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

How to apply colors for options of option set field

$
0
0

Hi Friends,


I am using below code to apply colors for options of  option set. But its not working. We are using MSCRM 2013 on premise. Any Suggestions please?

function colourOptionSetValues(field) {
    var picklist = document.getElementById(field); // Get the picklist
    var option1 = picklist.options[0]; // Value 1
    var option2 = picklist.options[1]; // Value 2
    var option3 = picklist.options[2]; // Value 3

    option1.style.backgroundColor = "#5EFB6E"; // Change colour to Green if '1'
    option2.style.backgroundColor = "#FFF380"; // Change colour to Yellow if '2'
    option3.style.backgroundColor = "#E55451"; // Change colour to Red if '3'
}

Thanks for  your help.


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>