Changing the background colour of a tabe cell, according to the selection in a drop down list | Community
Skip to main content
Staffle
New Participant
October 5, 2015
Solved

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

  • October 5, 2015
  • 12 replies
  • 9222 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by _Bruce_Robertson

Hi,

I think you should be able to use the following code in the change event of the dropdownlist.

form1.#subform[0].Table1.Row2.DropDownList1::change - (JavaScript, client)

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";    

}

Regards

Bruce

12 replies

Staffle
StaffleAuthor
New Participant
October 6, 2015

Thank you for your patience Bruce!

I applied your suggestion but unfortunately, it does not change the colour. I put the form in question Project Status Report on the Google drive:

https://drive.google.com/drive/folders/0B2VrTxepsjnsUWRGeG9SblZPSTA

The other two forms in that folder are from an earlier inquiry. The Tabletest works fine but the same approach in the Bulk IT...does not propagate rows to the next page and for the life of me, I cannot figure out why.

THX again,

Lisa

_Bruce_Robertson
_Bruce_RobertsonAccepted solution
New Participant
October 6, 2015

Hi,

I think you should be able to use the following code in the change event of the dropdownlist.

form1.#subform[0].Table1.Row2.DropDownList1::change - (JavaScript, client)

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";    

}

Regards

Bruce