sharepoint2010修改survey里面special your own value的方法

本文介绍如何通过在SharePoint Designer 2010中编辑NewForm.aspx页面,使用Content Editor Web Part及JavaScript代码,来修改SharePoint调查表单中的默认文本显示,使其更加友好。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1. Open the site in SharePoint Designer 2010
  2. Go to the Lists and Libraries, and select the Survey you want to edit from the content window:
    image
  3. Click on the “NewForm.aspx” file in your main content window:
    image
  4. Now add a Content Editor Web Part right below the standard ListFormWebPart, like so…
    image
  5. Now, as for the content, it gets a bit tricky, you’ll want to go down to where the <;Content>; tag is for your Content Editor Web Part and add the following code between the brackets in the CDATA[]
    <;script type="text/javascript">;
         var labels = document.getElementsByTagName("label");
         for(var i = 0; i <; labels.length; i++)
         {
                if(labels[i].innerText == "Specify your own value:")
                     labels[i].innerText = "Other:";
         }
    <;/script>;

    It should look like the following on your screen:

    image

  6. Ok, save the NewForm.aspx page and you’re done.  Now when a user goes to take the survey, the ugly “Specify your own value:” is replaced with a nice friendly “Other:”

    image

  7. Even better, because we used SharePoint web parts to achieve this, we only experience overhead on this specific page, we didn’t have to edit out of box code, and because we stayed within the normal confines of editing the NewForm.aspx it means our file doesn’t get UnGhosted!  Winner! 

    image

Be Sociable, Share!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值