
Copy link to clipboard
Copied
i have tried 2 methods to add a way to show/hide a label from a dropdown event.
method 1 - add to the dropdown > format > custom keystroke script
var lblServiceUnit = this.getField("lblServiceUnit");
var FacilityType = this.getField("Facility Type");
console.println(FacilityType.value);
if (FacilityType.value=="Federal") {
lblServiceUnit.display = display.visible;
} else {
lblServiceUnit.display = display.hidden;
}
when i change the drop down it always seems to printout the last value and not the current value. i am changing the dropdown via mouse.
method 2 -
dropdown > actions > select trigger > ? mouse up or onblur or mouse exit
the javascript added here is the same as above but it does not seem to fire at the right time. i have to click out and sometimes click back into the dropdown to see it fire.
1 Correct answer
Go to the properties of the drop-down and under the Options tab tick the "Commit selected value immediately".
Copy link to clipboard
Copied
Move the code to the validation event and use event.value instead of FacilityType.value .

Copy link to clipboard
Copied
this event.value at this point in validation event works but ONLY when you focus off the drop down.
same thing for the events in the ACTION tab (on blur, on mouse down enter exit)
for the ACTION (on mouse down enter exit) the event is blank and the direct value is unchanged UNTIL i defocus off the dropdown.
for the ACTION (onblur) it correctly works as validation event works but ONLY when you focus off the drop down.
is there no way to this to fire when the drop down changes but does not lose focus?
i am having 3 different options show up after selecting a choice from the dropdown. it seems confusing that the end user won't see those options UNTIL he defocuses off the dropdown.
so i can get this working but seems unfriendly to the end user.
Copy link to clipboard
Copied
Go to the properties of the drop-down and under the Options tab tick the "Commit selected value immediately".

