惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
云风的 BLOG
云风的 BLOG
G
Google Developers Blog
S
SegmentFault 最新的问题
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
DataBreaches.Net
F
Fortinet All Blogs
TaoSecurity Blog
TaoSecurity Blog
D
Docker
C
Cybersecurity and Infrastructure Security Agency CISA
K
Kaspersky official blog
宝玉的分享
宝玉的分享
腾讯CDC
Google Online Security Blog
Google Online Security Blog
Recorded Future
Recorded Future
T
The Exploit Database - CXSecurity.com
T
The Blog of Author Tim Ferriss
V
V2EX
S
Securelist
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
CERT Recently Published Vulnerability Notes
A
Arctic Wolf
Scott Helme
Scott Helme
L
LINUX DO - 热门话题
Y
Y Combinator Blog
P
Proofpoint News Feed
T
Tor Project blog
AWS News Blog
AWS News Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
博客园 - 聂微东
T
Threat Research - Cisco Blogs
B
Blog
Attack and Defense Labs
Attack and Defense Labs
L
Lohrmann on Cybersecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
N
News and Events Feed by Topic
博客园 - 司徒正美
H
Help Net Security
C
Cisco Blogs
C
Check Point Blog
S
Secure Thoughts

博客园 - Michael Zhang

MacBook Home End SLES Install cucumber soapui test web services S/4 HANA Solution Manager Linux下创建新用户 su with hyphen and without - su带横杠和不带横杠 2008 R2中的无线连接 wireless 不实用,还小有点意思-IE6 UI测试中的小发现 [转载]一个回收站小工具---RecycleBin Gotcha SharePoint开发中的小点滴 Document Library的URL 添加新的站点栏目类型(New Custom Field (Column) Type) 完全控制SharePoint站点菜单(Get full control of SharePoint ActionMenus) Part 1 从WSS 3.0到MOSS 2007 WSS文档库备份及复制 如何备份sharepoint中的文档库? Document Library中Server Menu问题(New和Upload菜单消失) 站点迁移 从单机到服务器场 从上海到大连 又出现两个问题 关于Alert和WebDAV Sharepoint 2007 Forms认证与File Not Found错误
尝试改变Survey完成后的默认行为(JavaScript)
Michael Zhang · 2009-02-16 · via 博客园 - Michael Zhang

Survey是很实用的WSS组件,可以用来做调查,在线测试.

近日在浏览SharePoint Forums时,看到有人问怎么给Finish按钮增加javascript功能,

一开始回复了思想和方法,建议他改变Form参数Action中的Source部分,

后来自己试了试,因为对JavaScript已经生疏,忘记了Function怎么转换为String和String怎么转换为Function,没有成功,今天了解了下Function,于是完善代码,并测试通过.

与大家共享:

<script type="text/javascript">
var inputcCtrls = document.body.getElementsByTagName("input");
for(m=0; m<inputcCtrls.length; m++) {
  if(inputcCtrls[m].type=="button"&&inputcCtrls[m].value=="Finish")
  {
    var funcHack= inputcCtrls[m].onclick;
    var strHack = String(funcHack);
    var startParenth = strHack.indexOf('{');
    strHack = strHack.substring(startParenth+1);
    var endParenth = strHack.indexOf('}');
    strHack = strHack.substring(0, endParenth-1);
    strHack = " if(confirm('Want to create a new response?')) { document.forms[0].action = 'NewForm.aspx?Source=http%3a%2f%2fservername%2fLists%2fSurveyName%2fNewForm.aspx'; } else { document.forms[0].action = 'NewForm.aspx?Source=http%3a%2f%2fservername%2fLists%SurveyName%2foverview.aspx'; } " + strHack;
    var modifyFinishBehavior = new Function(strHack);
    inputcCtrls[m].onclick = modifyFinishBehavior;
    }
}
</script>

使用方法: 把js代码复制粘帖到NewForm.aspx中.