Lambert 的个人资料Lambert Qin's technical ...照片日志列表更多 工具 帮助

日志


8月31日

Create an survey with pictures and other HTML formats

One of the limitations of SharePoint is that it only support an simple text format survey which is not enough for many scenarios.

However, create a full customized ASP.NET survey for SharePoint is not easy, it involves a lot of coding work.

Here is an general method that help administrartors and power users who have limited coding skill to build a beautiful survey.

Step 1: create an OOB survey.

image

Step 2: Open the survey in SharePoint Designer,upload a picture which would be used later.

image

Step 3:Create a HTML page in SharePoint Designer, design your survey. Copy the HTML code.

image

Step 4:Paste the HTML into the question (notice: must include the Table tag)

image

Preview:

image

Step 5:Copy the JavaScript to the form files (newForm,editForm and etc.)

document.getElementsByTagName('Table').item(0).outerHTML
=
document.getElementsByTagName('Table').item(0).outerHTML.replace(/&lt;/g,'<').replace(/&gt;/g,'>');

Tips: if you do not know where to insert the code, look for the following area which contains an OOB JavaScript code

image

Preview:

image

 

Comments:

The functionality of the JavaScript converts the escape character back, so that the pictures and HTML codes display correctly.

 

Updates [2009-11-02]:

Thanks 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,'>');

评论

请稍候...
很抱歉,您输入的评论太长。请缩短您的评论。
您没有输入任何内容,请重试。
很抱歉,我们当前无法添加您的评论。请稍后重试。
若要添加评论,需要您的家长授予您相应权限。请求权限
您的家长禁用了评论功能。
很抱歉,我们当前无法删除您的评论。请稍后重试。
您已超过了一天之内允许提供的评论数上限。请在 24 小时后重试。
因为我们的系统表明您可能在向其他用户提供垃圾评论,您的帐户已禁用了评论功能。如果您认为我们错误地禁用了您的帐户,请联系 Windows Live 支持部门
完成下面的安全检查,您提供评论的过程才能完成。
您在安全检查中键入的字符必须与图片或音频中的字符一致。

若要添加评论,请使用您的 Windows Live ID 登录(如果您使用过 Hotmail、Messenger 或 Xbox LIVE,您就拥有 Windows Live ID)。登录


还没有 Windows Live ID 吗?请注册

引用通告

此日志的引用通告 URL 是:
http://lambertqin.spaces.live.com/blog/cns!E93C48B467E6B3E1!1121.trak
引用此项的网络日志