- Posts: 153
- Thank you received: 8
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
insert image with if condition
- KompetenzZ
- Topic Author
- Offline
- Premium Member
Less
More
5 years 4 months ago - 5 years 4 months ago #177864
by KompetenzZ
Cheers kompetenzz
insert image with if condition was created by KompetenzZ
Hi,
I think maybe I've read something about this topic before, but I cannot find it in the forum again. I tried to insert images with a if condition:
I found that "Filter HTML for XSS" should be disabled manual.limesurvey.org/Expression_Manager#XSS_security
So, I disabled it, but I guess insert images with if conditions does not work. Is there another way to insert images based on previous answers?
I think maybe I've read something about this topic before, but I cannot find it in the forum again. I tried to insert images with a if condition:
Code:
{if((Q1=="1"), "<img src="abc.png" />", "<img src="xyz.png")}
I found that "Filter HTML for XSS" should be disabled manual.limesurvey.org/Expression_Manager#XSS_security
So, I disabled it, but I guess insert images with if conditions does not work. Is there another way to insert images based on previous answers?
Cheers kompetenzz
Last edit: 5 years 4 months ago by KompetenzZ.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13643
- Thank you received: 2491
5 years 4 months ago #177866
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic insert image with if condition
double quote inside double quote : it broke.
And last image not closed
It must be OK with XSS too
And last image not closed
It must be OK with XSS too
Code:
{if((Q1=="1"), '<img src="abc.png" />', '<img src="xyz.png">')}
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- KompetenzZ
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 153
- Thank you received: 8
5 years 4 months ago #177875
by KompetenzZ
Cheers kompetenzz
Replied by KompetenzZ on topic insert image with if condition
That is my aha-experience for today. Sorry I just forgot to close the image in the last example code.
This means that double quotes are only compatible with single quotes inside, vice versa. Thank you, I didn't know that.
This means that double quotes are only compatible with single quotes inside, vice versa. Thank you, I didn't know that.
Cheers kompetenzz
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11658
- Thank you received: 2742
5 years 4 months ago #177878
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic insert image with if condition
Of course. The program is stupid. When you open a " the next " that comes closes things. Limesurvey (or any other program) won't know that this is actually a new opening ".This means that double quotes are only compatible with single quotes inside, vice versa.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The following user(s) said Thank You: DenisChenu, KompetenzZ
The topic has been locked.
- KompetenzZ
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 153
- Thank you received: 8
5 years 4 months ago #178065
by KompetenzZ
Cheers kompetenzz
Replied by KompetenzZ on topic insert image with if condition
Just for reference, now I found the also the old thread on this topic for further reading:
www.limesurvey.org/forum/installation-a-...for-questions#168436
www.limesurvey.org/forum/installation-a-...for-questions#168436
Cheers kompetenzz
The topic has been locked.