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

I am trying to create a textbox that the fill color will change according to input in a dropdown box named "DropdownColor" in has 5 choices red, green, blue, yellow and ****. in the texbox I added a validate javascript as follow:

New Here ,
Jul 04, 2019 Jul 04, 2019

Copy link to clipboard

Copied

I am trying to create a textbox that the fill color will change according to input in a dropdown box named "DropdownColor" in has 5 choices red, green, blue, yellow and ****. in the texbox I added a validate javascript as follow:

{

var vcolor = event.value;

if (vcolor == "") this.getField('DropdownColor').fillColor = color.transparent

else if (vcolor == "yellow") this.getField('DropdownColor').fillColor = color.yellow

else if (vcolor == "blue") this.getField('DropdownColor').fillColor = color.blue

else if (vcolor == "red") this.getField('DropdownColor').fillColor = color.red

else if (vcolor == "green") this.getField('DropdownColor').fillColor = color.green

else this.getField('DropdownColor').fillColor = color.transparent;

}

the text box color never changes from the bluish default color.

What am I doing wrong?

Amos Madanes

TOPICS
Acrobat SDK and JavaScript

Views

220

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 ,
Jul 04, 2019 Jul 04, 2019

Copy link to clipboard

Copied

What is the name of the text field?

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 ,
Jul 04, 2019 Jul 04, 2019

Copy link to clipboard

Copied

LATEST

Are you trying to change the text field or the drop-down field? Also, disable the fields highlighting to be able to see the actual fill color of your fields...

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