I have a client requirement to change the background colour of values in a dropdown control based on user selection
For example, when user selects “Green” Option from the dropdown - the dropdown background colour should appear as “Green” similarly when user selects “Red” the background colour of dropdown should appear as “Red”.
Any inputs or suggestion to achieve the above requirement please?
I will let other users comment who may have implemented the required logic required to change the colour immediately on value selection. There are some similar forum questions such as this one and this one .
For the dropdown control, put a class(like “DPControl”) in the properties control.
Then onclick/change of dropdown, you need to do RunScript and pass a parameter(say color). In the script, you would need to write a function where based on the parameter, you put the background color of the div with the classname “DPControl”.
But it can’t meet our requirement, it should always display a particular colour for that selected option, when we going to change the drop down value it should able to display the corresponding colour.