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");
            }
    });
});
2

1 Answer 1

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

2
  • Thank you for this example. It is exact solution for my problem :). Commented Jun 14, 2016 at 9:57
  • Glad to help you. Commented Jun 14, 2016 at 10:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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