Adding an image with EM does not work?

More
3 years 5 months ago - 3 years 5 months ago #105678 by orvil
orvil created the topic: Adding an image with EM does not work?
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:
<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:
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: 3 years 5 months ago by orvil.

Please Log in to join the conversation.

More
3 years 5 months ago #105689 by orvil
orvil replied the 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

Best regards/Beste Grüße,
O. Villani

Please Log in to join the conversation.

More
3 years 5 months ago #105700 by tpartner
tpartner replied the 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?


.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
3 years 5 months ago #105738 by orvil
orvil replied the 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

Please Log in to join the conversation.

More
3 years 5 months ago #105755 by DenisChenu
DenisChenu replied the 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:
<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>
Maybe some fix to do.

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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

Did you already participate in our customer survey?

Don't miss your chance for great prices.

Please click here to participate:

Start now

Start now!

Just create your account and start using Limesurvey today.

Register now