Create an illustrated survey

Source: Internet
Author: User

The SharePoint survey list, by default, only supports simple text surveys and does not meet most of the requirements, and it takes a lot of work to customize a pretty little survey. In order to make most of the developers know little about the SharePoint administrator or advanced users can easily produce an illustrated survey, close-up of this article.

Step one: Create a general survey list.

Step Two: Open the survey in SharePoint Designer and upload a picture for backup.

Step three: Create a new HTML page in the middle of SharePoint Designer to copy the display style of the problem

Step Fourth: Copy the generated code and paste it into the middle of the survey question (note that you include the table tag)

Preview:

Step Fifth: Copy the following JavaScript code to each file

document.getElementsByTagName (' Table '). Item (0). outerhtml
=
document.getElementsByTagName (' Table '). Item (0). Outerhtml.replace (/&lt;/g, ' < '). Replace (/&gt;/g, ' > ');

Tip: If you don't know where to put the code, you're looking for a snippet of code in the file, which has a JavaScript code to just put your code down.

Preview results:

Description

The function of JavaScript code here is to turn the characters that are escaped by SharePoint back again so that HTML formats like pictures can be displayed properly.

Updated [2009-11-02]:

For Mike Sharp ' s idea here:http://social.technet.microsoft.com/forums/en-us/sharepointcustomization/thread/ 8b97bc31-f72d-4104-bd40-d8d72a8f7fbf

There should be a potential for XSS, and narrow the scope of what gets un-escaped should reduce the risks:

For Dispform, NewForm and editform pages. Using
document.getElementById (' Onetidlistform '). rows[0].cells[0].innerhtml = document.getElementById (' OnetIDListForm ') . Rows[0].cells[0].innerhtml.replace (/&lt;/g, ' < '). Replace (/&gt;/g, ' > ');
For the Summary page doesn ' t have the same onetidlistform cell, using the ID of the Web Part Zone TD Cell:
document.getElementById (' msozonecell_webpartwpq2 '). InnerHTML = document.getElementById (' msozonecell_webpartwpq2 ') ). Innerhtml.replace (/&lt;/g, ' < '). Replace (/&gt;/g, ' > ');

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.