Copy link to clipboard
Copied
I have 9 icon fields which are all hidden. I have three drop-down menus, each with three selections (Worth mentioning, each is set to Commit value immediately).
The code I have written is based on examples I have found in other threads regarding similar issues.
My code, which produces nothing, only connects itself to three fields and is as follows:
if (event.value == "12 O'Clock")
{
this.getField("MCO - L").display = display.visible;
this.getField("MCO - L10").display = display.hidden;
this.getField("MCO - L2").display = display.hidden;
}
else if (event.value == "10 O'Clock")
{
this.getField("MCO - L").display = display.hidden;
this.getField("MCO - L2").display = display.hidden;
this.getField("MCO - L10").display = display.visible;
}
else if (event.value == "2 O'Clock")
{
this.getField("MCO - L").display = display.hidden;
this.getField("MCO - L10").display = display.hidden;
this.getField("MCO - L2").display = display.visible;
}
What I want to achieve is a code that shows two fields and keeps the rest hidden. For example purposes, refer to them as Icon1 & Text1.
Copy link to clipboard
Copied
You don't need the condition. This is sufficient:
event.target.display = this.getField("MCO - L10").display;
Copy link to clipboard
Copied
Script looks ok. What is the issue exactly?
Copy link to clipboard
Copied
Apologies Nesa, it would seem the largest fault was that a suffix had been added to each icon [af_image].
My formula is correct, hussah! I need to have a text field become visible dependant on the selection made. How might I achieve this?
Copy link to clipboard
Copied
Script should already do that.
What is the name of the field you wish to show/hide, and what are the choices in the dropdown?
Copy link to clipboard
Copied
A text field not within the drop-down menu. Text field Distance to LMC - L10 to be shown when MCO - L10 is visible.
Copy link to clipboard
Copied
If "MCO - L10" field is visible, "LMC - L10" field should also be visible, else it should be hidden?
You can use this as calculate script of "LMC - L10" field:
event.target.display = this.getField("MCO - L10").display == display.visible ? display.visible : display.hidden;
Copy link to clipboard
Copied
You don't need the condition. This is sufficient:
event.target.display = this.getField("MCO - L10").display;