Skip to main content
Participating Frequently
April 12, 2022
Question

Auto-fill color dropdown

  • April 12, 2022
  • 1 reply
  • 1241 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
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.

 

 

try67
Community Expert
April 14, 2022

 


Seems fine to me. If it's not working share the file.