function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vikramkkvikramkk 

Highlighting color when a picklist value is selected

Hi all

 

There is a field of type - picklist. It contains four picklist values. I want to create a horizontal bar or horizontal thick line divided in to four different colors(this can be created in separate section) i.e each picklist value correspond to one color in the bar. When one of those values is selected for that field and after the record is saved, corresponding color in the bar is highlighted.

 

How this can be achieved? How can I create a horizontal bar like that - using visual force or is there any other means?

 

(horizontal bar is what we see when coompleting a form -  bar which shows some percentage of bar in different color which is filled and other in different color which is yet to be filled)

 

hope u understand

Afzal MohammadAfzal Mohammad

You can use a combination of css and javascript for coloring the picklist values. Refer http://www.webdeveloper.com/forum/archive/index.php/t-127602.html for an example.

 

However, for the horizontal bar, you should have four dirrerent images for each color. Add them as static resources and render them on your vf page accordingly to the picklist value selected. You may do something like this

 

Hope that helps.

 

Afzal