[急] sharepoint新表格列表office365 [英] [Urgent] sharepoint new form list office365

查看:146
本文介绍了[急] sharepoint新表格列表office365的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为列表使用了新的表单模板,当我点击取消它应该重定向到主页,请帮助。



Blitz

i have used new form template for the list and when i click cancel it should redirect to the Home page and please help.


Blitz

推荐答案

嗨Sree,

请使用内容编辑器Web部件中的以下脚本覆盖取消按钮重定向:

Please use the script below in Content Editor Web Part to override Cancel Button redirection:

<script type="text/javascript">

function goToByePage(){
     window.location.assign("https://xxx.sharepoint.com/sites/xxx/SitePages/Home.aspx");
}

function overrideCancel()
{
	//Custom input button
	var input = document.createElement('input');
	input.type = "button";
	input.name = "Cancel";
	input.value = "Cancel";
	input.id = "custominput";
	document.querySelectorAll('.ms-toolbar input[value=Cancel]')[1].parentNode.appendChild(input);
	document.getElementById("custominput").setAttribute("class", "ms-ButtonHeightWidth");
	
	//Hiding already implemented cancel buttons
	document.querySelectorAll('.ms-toolbar input[value=Cancel]')[0].style.display = "none";
	document.querySelectorAll('.ms-toolbar input[value=Cancel]')[1].style.display = "none";
	
	//this is main logic to move history back
	document.getElementById("custominput").setAttribute("onclick", "goToByePage();");
}



_spBodyOnLoadFunctionNames.push('overrideCancel');
</script>

<style type="text/css">
#Ribbon\.ListForm\.Edit\.Commit\.Cancel-Large
{
	display:none;
}
</style>

将window.location.assign中的网址替换为 你的。

Replace the url in window.location.assign with  yours.

谢谢

最好的问候


这篇关于[急] sharepoint新表格列表office365的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆