Unable to hide/reveal images like text
Hey all,
I'm working on a project where I need the choice on a dropdown menu to reveal and hide certain fields. I wrote a code that works just fine for text fields but will not work with an image field. Code below:
switch(event.value) {
case "Option A":
this.getField("Text 1").display=display.visible;
this.getField("Text 2").display=display.hidden;
this.getField("Image 1").display=display.visible;
this.getField("Image 2").display=display.hidden;
break;
case "Option B":
this.getField("Text 1").display=display.hidden;
this.getField("Text 2").display=display.visible;
this.getField("Image 1").display=display.hidden;
this.getField("Image 2").display=display.visible;
break;
}
With this code applied to my Dropdown field my Text fields swap just fine, but the Images remain visible no matter the dropdown option chosen. Another thing I noticed is that whenever I rename an Image field it becomes a Button automatically. I thought that might be the issue, but I adjusted the code for the auto-populated Image field name and still had the same issue. Are Images and/or Buttons unable to be hidden/revealed, or is there a setting I am missing somewhere?
Cheers!
