1

I need to add images to each response in sharepoint 2013 survey like this: enter image description here I had no problem with question image. I just added string "image1" to question and then in jquery switched html like this:

$(document).ready(function() {


    $(function () {
        $(".ms-formlabel").each(function (index) {
            var html = $(this).html();
            if (html.indexOf("image1") != -1) {

                $(this).html("<img src='https://portal.sp.corpnet.pl/witryny/ankiety/Config/images/zdjecie1-pytanie1.png'><br>1. Ten sympatyczny młody człowiek na zdjęciu to:");
            }


        });
    });
});

But in answers/responses I have radio buttons with labels and I am not able to use same method. Maybe there is another way.

Solution:

$(document).ready(function() {
    $(".ms-formbody label").each(function() {
        var kontent = $(this).html();
            if (kontent.indexOf("pytanie1-odpowiedz1") != -1) {
                $(this).html("test1");
            }
            else if (kontent.indexOf("pytanie1-odpowiedz2") != -1) {
                $(this).html("test2");
            }
    });
});
0

In this link, it has SharePoint 2010 illustration, but it will give you good reference.

Please refer this link: http://sharepointkings.blogspot.in/2011/05/include-image-in-sharepoint-survey.html

  • Thank you for this example. It is exact solution for my problem :). – omygoodness Jun 14 '16 at 9:57
  • Glad to help you. – Dikesh Gandhi Jun 14 '16 at 10:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.