Copy link to clipboard
Copied
Hello,
I am new to this and working on trying to change the color and font of only ONE specific dropdown selection out of many multiple within that dropdown list. Is there a way of doing this without having to select each and every selection item I have in the code?
I have set the primary color of the dropdown selections to RED, but if the user selects NONE SELECTED, I want this to show as a Bold Black color style.
Is this possible?
Copy link to clipboard
Copied
Select "Commit selected value immediately" in the options tab of the field properties, then enter the following custom keystroke script:
if(!event.willCommit)
{
if(event.changeEx=="NONE SELECTED")
{
event.target.textFont="Helvetica-Bold";
event.target.textColor=color.black;
}
else
{
event.target.textFont="Helvetica";
event.target.textColor=color.red;
}
}
Copy link to clipboard
Copied
if (event.changeEx=="NONE SELECTED" || event.changeEx=="Something else")
Copy link to clipboard
Copied
You can't. Not an option. Cool idea though!
Copy link to clipboard
Copied
Do you mean the color is different for one selection when viewing them all in the expanded dropdown, or do you mean you want one of them different once it is selected?
Copy link to clipboard
Copied
Select "Commit selected value immediately" in the options tab of the field properties, then enter the following custom keystroke script:
if(!event.willCommit)
{
if(event.changeEx=="NONE SELECTED")
{
event.target.textFont="Helvetica-Bold";
event.target.textColor=color.black;
}
else
{
event.target.textFont="Helvetica";
event.target.textColor=color.red;
}
}
Copy link to clipboard
Copied
This is EXACTLY what I needed, thank you so much!
Copy link to clipboard
Copied
Is there also a way to add an OR statement that will allow 2 possible selections to be black wile the remaining selections would be red?
Copy link to clipboard
Copied
if (event.changeEx=="NONE SELECTED" || event.changeEx=="Something else")
Copy link to clipboard
Copied
Thank you! That worked!
Copy link to clipboard
Copied
Just be aware this doesn't change just the selection you make, but all the items in the drop-down. If you open it again after making that selection you will see that.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now