how to add javascript to show/hide field
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.
