Skip to main content
amadanes
Participant
July 4, 2019
Question

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:

  • July 4, 2019
  • 2 replies
  • 312 views

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

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
July 4, 2019

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...

Bernd Alheit
Community Expert
Community Expert
July 4, 2019

What is the name of the text field?