- Posts: 111
- Thank you received: 20
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Adding an image with EM does not work?
- orvil
- Topic Author
- Offline
- Premium Member
Less
More
10 years 1 month ago - 10 years 1 month ago #105678
by orvil
Best regards/Beste Grüße,
O. Villani
Adding an image with EM does not work? was created by orvil
Hi all,
currently I'm trying to add an image into a question text by using the EM.
The question text in plain html is like this:
unfortunately the result for the image link in the question is like this:
- The image itself is uploaded jet, of course
- the expressin {imageList_SQ001.code)} standalone leads to the proper filename
Any ideas how to avoid encoding of the image-file?????
currently I'm trying to add an image into a question text by using the EM.
The question text in plain html is like this:
Code:
<p>Have you seen this person recently? </p> <p><img src="/limeSurvey/upload/surveys/123456/images/{imageList_SQ001.code}" /></p>
unfortunately the result for the image link in the question is like this:
Code:
http://www.mydomain.com/limeSurvey3/upload/surveys/123456/images/%3Cspan%20id=%27LEMtailor_Q_107_316%27%3Epicture1.jpg%3C/span%3E
- The image itself is uploaded jet, of course
- the expressin {imageList_SQ001.code)} standalone leads to the proper filename
Any ideas how to avoid encoding of the image-file?????
Best regards/Beste Grüße,
O. Villani
Last edit: 10 years 1 month ago by orvil.
The topic has been locked.
- orvil
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 111
- Thank you received: 20
10 years 1 month ago #105689
by orvil
Best regards/Beste Grüße,
O. Villani
Replied by orvil on topic Adding an image with EM does not work?
Hm, found the reason for this behavior:
This behavior is only, when these 2 questions are displayed at once (because of using JaveScript by LS).
Once these questions are displayed separately (question-by-question, or group-by-group mode and these questions are in different groups) it will work fine.
Anyhow, I could not find a solution if I have to display these questions at once!
Any ideas for this case?
THX
This behavior is only, when these 2 questions are displayed at once (because of using JaveScript by LS).
Once these questions are displayed separately (question-by-question, or group-by-group mode and these questions are in different groups) it will work fine.
Anyhow, I could not find a solution if I have to display these questions at once!
Any ideas for this case?
THX
Best regards/Beste Grüße,
O. Villani
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
10 years 1 month ago #105700
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Adding an image with EM does not work?
I'm confused as to how you can have subquestion codes for imageList like "image1.png".
Can you attach a small sample survey?
.
Can you attach a small sample survey?
.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- orvil
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 111
- Thank you received: 20
10 years 1 month ago #105738
by orvil
Best regards/Beste Grüße,
O. Villani
Replied by orvil on topic Adding an image with EM does not work?
Please don't be confused. The name 'imageList' is only the name of a (hidden) multiple short text question where the filenames are stored.
Best regards/Beste Grüße,
O. Villani
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13642
- Thank you received: 2491
10 years 1 month ago #105755
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 Adding an image with EM does not work?
If the question is in the same grpup (the same page) then it was updated each time user select another answer. Then it need the <span> .
Think best is to use something like that:
Maybe some fix to do.
Denis
Think best is to use something like that:
Code:
<img id="img1" src="" /><div id="srcimg1" style="display:none">{imageList_SQ001.code}</div> <script> $(function() { $("#img1").attr('src','/limeSurvey/upload/surveys/123456/images/'+$("#srcimg1").text()); }); $("#question{imageList_SQ001.qid} input.radio").click(function(){ $("#img1").attr('src','/limeSurvey/upload/surveys/123456/images/'+$("#srcimg1").text()); }); </script>
Denis
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.