Skip to main content
tonyal61000932
Participant
November 12, 2018
Question

Auto-populate image with text field

  • November 12, 2018
  • 1 reply
  • 352 views

How would you auto-populate an image with the conditional of a text field if the images are on the same document?

If you type A in text field 1 then an apple appears (image 1).  Is this possible?  How do I do this?

Thank you!

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
November 12, 2018

You can set a button field to display an image. Then all you need to do is create two buttons, one for each image, and then show/hide them based on the value of the text field.

You can use something like this as the text field's custom validation script to achieve it:

this.getField("AppleImage").display = (event.value=="A") ? display.visible : display.hidden;

this.getField("BananaImage").display = (event.value=="B") ? display.visible : display.hidden;