Select input to show image based on selection

Simon Tayler shared this question 4 years ago
Answered

I'm trying to create an expression whereby an image will be shown once someone selects an option from a select field. Is this possible? If so, how do I go about it or what expressions would I use?

Comments (3)

photo
1

Hi Simon,


To have an example imagine you want to have 3 images and the options from the dropdown are the thre images.


A good way to simulate this would be to create a dynamic panel with three panels.


then you put each image in a different panel from the dynamic panel.


Now you have to set an event on the selection widget. Choose the "on Change" event and then add a condition. In the condition builder drag the "=" sign and on one side drag the selection widget and on the other double click and write the first item in the list. Then click on ok.


Now you have to define the action for this condition. To do this choose the "Set Active Panel" action and choose the panel that contains the image related to the first item in the selection list.


When the event is created you will see "else". Click it and a new event builder will appear. Repeat the process but this time for the second element; then the third.


I hope this helps you in your prototype.


Best,


Marc

photo
1

Hi Marc


I built your solution and it worked. My question is this:


1) Lets say your select list is Alaska, California, Texas.


2) Now in the condition builder you put the text as "Alaska", so as of now it would work.


3) Tomorrow I want to change the select list to AK, CA, TX.


4) Would I have to go back into the condition builder and change "Alaska" to "AK"?


I am guessing it is case sensitive, so if you have any typos or change anything it will not work right?

photo
1

Yes you are right!


Best,


Sonia Durán