Skip to main content
Participating Frequently
April 12, 2022
Question

Auto-fill color dropdown

  • April 12, 2022
  • 1 reply
  • 1255 views

I am trying to get my dropdowns to auto-fill with yellow when someone chooses "N" or No but do not like the harsh generic yellow.  I have tried to research how to enter one of the other colors by using their RGB on a 0-1 scale.  My question is where would I need to insert the RGB in my current script:

 

event.target.fillColor=(this.getField("Dropdown35").valueAsString=="N")? color.yellow:color.transparent;

 

And how should I enter it? All the forums I have read have =["RGB",value,value,value] 

 

Thank you!

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
April 12, 2022

Just replace color.yellow with what you found, so something like this:

 

event.target.fillColor=(this.getField("Dropdown35").valueAsString=="N")? ["RGB",255/255,255/255,224/255] : color.transparent;

 

This will result in a light yellow color.

 

Participating Frequently
April 12, 2022

I am getting a Syntax error when I try that.

 

 

Participating Frequently
April 12, 2022

So I see you removed the word color. before the color calculations but now I have run into another problem.  It highlights the box with every selection when I only want it to highlight when "N" is chosen.  But the good news is the yellow is correct.  Any thoughts on why it might be highlighting all the selections now just because I removed color.?