Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Changing the background colour of a tabe cell, according to the selection in a drop down list

Avatar

Avatar
Validate 1
Level 1
Staffle
Level 1

Likes

2 likes

Total Posts

32 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
Staffle
Level 1

Likes

2 likes

Total Posts

32 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Staffle
Level 1

05-10-2015

I have a drop-down list wrapped in a subform in a table cell. Users can pick Green, yellow or red and I want the background colour to change according to their selection.

Can you tell me why this script is not working? I am sure some of you folks can see it in a second.


if (this.ListItem=="green") {

Subform1.DropDownList1.fillColor = "000,128,000"; BackgroundFill="solid";

}                  

if (this. ListItem=="yellow") {

Subform1.DropDownList1.fillColor = "255,128,000";

}

if (this.ListItem=="red") {           

Subform1.DropDownList1.fillColor = "255,000,000";     

}


Thanks

View Entire Topic

Avatar

Avatar
Validate 1
Level 1
Staffle
Level 1

Likes

2 likes

Total Posts

32 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
Staffle
Level 1

Likes

2 likes

Total Posts

32 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Staffle
Level 1

13-10-2015

Hi Bruce,

I checked all the cells with scripts and there is nothing on an exit event.The problem was that the subforms were all called Subform1 instead of 1, 2, 3, 4.

So, this code works fine now:

if (xfa.event.change=="green") {

  this.fillColor = "000,128,000";

}                 

if (xfa.event.change=="yellow") {

  this.fillColor = "255,128,000";

}

if (xfa.event.change=="red") {          

  this.fillColor = "255,000,000";    

}

Many thanks...all good!!!

Lisa