Mylene Posted June 28, 2017 Report Share Posted June 28, 2017 Hi, I need to display needed image in html block on the results page depending on a value in a field. I placed files into app parameters, however, it seems that I cannot create correct syntax. If someone faced the same challenge, please help! Quote Link to comment Share on other sites More sharing options...
Mathilda Posted June 28, 2017 Report Share Posted June 28, 2017 Just now, Mylene said: Hi, I need to display needed image in html block on the results page depending on a value in a field. I placed files into app parameters, however, it seems that I cannot create correct syntax. If someone faced the same challenge, please help! I have a solution for this case. <script> var x = '[@field:field_with_values]'; if (x==100){ document.write('<img src="[@app:img1/]" style="width: 415px; height: 566px; margin: 1px;" />'); } else{ document.write('<img src="[@app:img2/]" style="width: 415px; height: 566px; margin: 1px;" />'); } </script> In my script: [@field:check_for_image] - field which is used for the condition. [@app:img1/] - is the first image [@app:img2/] - is the second image Image 1 appears when field with values=100, in other cases appears image2 Hope that helps Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.