Skip to main content
Participating Frequently
September 26, 2017
Answered

Swap images based on field value

  • September 26, 2017
  • 1 reply
  • 1207 views

Looking for some assistance with a PDF. I have two images that I need to display based on a value in another field. If the value of field A is X then show image 1 is field is Y then show image 2. Is this possible?

This topic has been closed for replies.
Correct answer try67

Show image B


Use something like this as the custom validation script of the text field:

var b = event.value.indexOf("Voice")==0;

this.getField("Image1").display = b ? display.visible : display.hidden;

this.getField("Image2").display = !b ? display.visible : display.hidden;

1 reply

try67
Community Expert
Community Expert
September 26, 2017

Yes, this is possible. Place the images as the icons of button fields and then show/hide those fields based on the value of field A.

Participating Frequently
September 26, 2017

Thanks I will give it a try.