Pages

Wednesday, December 15, 2010

Adding Pictures to Survey in Sharepoint

Question : - I am trying to add some pictures to a survery to be rated. I have looked at a couple of solutions on the google but nothing has come up useful. Does any have a solution that will work for Sharepoint 2007?

My solution : - You could add the insert the image  code before the question text, the question should looks like: Ques1:xxxx

Then add JavaScript code  to the newForm.aspx and editForm.aspx
document.getElementById('onetIDListForm').rows[0].cells[0].innerHTML
    =
    document.getElementById('onetIDListForm').rows[0].cells[0].innerHTML.replace(/<').replace(/>/g,'>');


It will work on DispForm, NewForm and EditForm pages. While for 'Summary page" , please use below code
document.getElementById('MSOZoneCell_WebPartWPQ2').innerHTML
    =
    document.getElementById('MSOZoneCell_WebPartWPQ2').innerHTML.replace(/<').replace(/>/g,'>');

No comments:

Post a Comment