Skip to main content
Participating Frequently
November 27, 2024
Question

If then scenarios to highlight multiple dropdown boxes

  • November 27, 2024
  • 1 reply
  • 1063 views

I am trying to figure out the script for highlighting multiple box when one items is choosen .

For Example, 

If I choose "DDA" in dropdown1 then I want Dropdown8, Dropdown15 and dropdown 18 to be highlighted in yellow. 

How do I write this script?  

 

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
November 27, 2024

By "highlight" do you mean something like change the fill color from white to yellow?

Participating Frequently
November 29, 2024

Yes, Correct

try67
Community Expert
Community Expert
November 29, 2024

You can use this code as the custom Validation script of the drop-down:

 

var DDAfields = ["Dropdown8", "Dropdown15", "dropdown 18"];
for (var i in DDAfields) {
	var f = this.getField(DDAfields[i]);
	f.fillColor = (event.value=="DDA") ? color.yellow : color.white;
}

 

I used the names you provided, but be aware they must match the actual field names EXACTLY for it to work, including lower-/upper-case letters, spaces, etc.