• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Change colour with dropdown list selection

New Here ,
Oct 11, 2023 Oct 11, 2023

Copy link to clipboard

Copied

Hello 

 

I have a simple Yes or No dropdown list, I want the color of the filed to change to red if no selected. Is there a simple code for that 

 

Thanks for the help

TOPICS
Acrobat SDK and JavaScript , Mac , Windows

Views

312

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 13, 2023 Oct 13, 2023

Votes

Translate

Translate
Community Expert ,
Oct 12, 2023 Oct 12, 2023

Copy link to clipboard

Copied

Use this as validate script of that dropdown:

event.target.fillColor = event.value == "No" ? color.red : color.white;

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 13, 2023 Oct 13, 2023

Copy link to clipboard

Copied

Hello dear 

 

thanks for the help 

May be I was not precise in my question

the code changes the color of the dropdown menu, I want the "No" answer highligted with a red field color 

 

Thanks very much

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 13, 2023 Oct 13, 2023

Copy link to clipboard

Copied

You can't change the color of a specific item in the drop-down, if that's what you mean.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 13, 2023 Oct 13, 2023

Copy link to clipboard

Copied

If you want to change the color of the text when "No" is selected, take a look at this post:

https://community.adobe.com/t5/acrobat-discussions/change-font-colors-for-choices-in-drop-down-list-... 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 14, 2023 Oct 14, 2023

Copy link to clipboard

Copied

LATEST

This works nicely 

thanks for the help

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines