- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2014 11:31 AM
I have a choice list with red, green, yellow, and I need it to display the actual color instead of the word when the user expands the dropdown. If I can't accomplish this through modifying the CSS, would it be possible to use a macro in place of the field?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2014 08:34 PM
No problem. Since it clears out the choice list onLoad, you have to grab the current value before it clears, then set the value back in after adding the options. I set the background color of the field at the end of the onLoad script and also with an onChange script. Here's part of the onLoad script...
g_form.clearOptions('u_risk_level');
var x = document.getElementById("u_deliverable.u_risk_level");
var option1 = document.createElement("option");
option1.text = "Green";
option1.name = "Green";
option1.value = "1";
option1.style.backgroundColor = '#32CD32';
option1.style.color = '#32CD32';
x.add(option1);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2014 07:54 PM
Right click on the fields, personalize styles.Create New.
In the value field, you can write: choicelist Value eg. Red
Regards,
Bhavesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2014 08:09 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2014 08:11 PM
I see....thats cool.Appreciate if you could share the script so it is handy when we need it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2014 08:34 PM
No problem. Since it clears out the choice list onLoad, you have to grab the current value before it clears, then set the value back in after adding the options. I set the background color of the field at the end of the onLoad script and also with an onChange script. Here's part of the onLoad script...
g_form.clearOptions('u_risk_level');
var x = document.getElementById("u_deliverable.u_risk_level");
var option1 = document.createElement("option");
option1.text = "Green";
option1.name = "Green";
option1.value = "1";
option1.style.backgroundColor = '#32CD32';
option1.style.color = '#32CD32';
x.add(option1);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2014 08:41 PM
Thank you