Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Conditional show for image

  • alexandre.bran
  • alexandre.bran's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 7 months ago - 1 year 7 months ago #241335 by alexandre.bran
Conditional show for image was created by alexandre.bran
Please help us help you and fill where relevant:
Your LimeSurvey version: [Version 3.25.6+201229]
Own server or LimeSurvey hosting: Own server
Survey theme/template: Fruity
==================
Hi,

I have an issue with making an image appear in an if-statement.
Basically, I have this simple code:
       <p>{if(CONDITION >1, "<img src=" /upload/surveys/964226/images/DIHA.png" />", 0)}</p>

The path is correct and the image appears in the editor when I exist source mode. However, when I test my survey, the image does not appear and I have this instead. 


Can you tell me what I am doing wrong?
Last edit: 1 year 7 months ago by alexandre.bran. Reason: typo

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 7 months ago #241336 by Joffm
Replied by Joffm on topic Conditional show for image
You use nested double quotes.
This is not possible.
You must use single quotes and double quotes alternately, single within double or vice versa

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

More
1 year 7 months ago #241338 by jelo
Replied by jelo on topic Conditional show for image

However, when I test my survey, the image does not appear and I have this instead. 
Can you tell me what I am doing wrong?
 
Not sure where this screenshot is from. Is that what a respondent sees in the survey?  If that is the case, I wonder why the condition is displayed too. That would be hidden and only the image would be seen. Looks like the htmlcode is messed up.
You might inspect the HTMLcode in the browser to see what is wrong with the HTML and the path.


 

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Please Log in to join the conversation.

  • alexandre.bran
  • alexandre.bran's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 7 months ago #241341 by alexandre.bran
Replied by alexandre.bran on topic Conditional show for image
That was is it, indeed.
Thank you!

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose