BtnSave点击事件+ CEWP + NewForm.aspx [英] BtnSave click event + CEWP + NewForm.aspx

查看:73
本文介绍了BtnSave点击事件+ CEWP + NewForm.aspx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义列表.我在New form.aspx中添加了内容编辑器Webpart.我添加了一个"PreSaveAction()".如果PreSaveAction很好并且满足所有验证条件,那么我还想在Save click事件中进行其他一些更改.

I have a custom list. I have added a content editor webpart in the New form.aspx. I have added a "PreSaveAction()". I also want to make some other changes in the Save click event, if the PreSaveAction is fine and all validations are met.

如何将其他代码添加到保存点击事件?是否可以自定义btnsave点击事件?如果是,如何使用JSOM实现它?

How to add additional code to the save click event? Is the btnsave click event can be customized? If yes, how to achieve it using JSOM?

谢谢

推荐答案

我们还可以在PreSaveAction()方法中添加一些其他代码来满足您的要求.

We can also add some additional code in the PreSaveAction() method to meet your requirement.

<script src="//code.jquery.com/jquery-1.11.3.min.js" type="text/javascript"></script> 
<script type="text/javascript">
//PreSaveAction code to validate
function PreSaveAction() {

	//add additional code
	
	var empNum =


('input [title ="Employee Number"]').val(); var table =
('input[title="Employee Number"]').val(); var table =


(#idAttachmentsTable tr"); if(empNum< 6 || empNum> 10){ alert('请提供6-10位数字的员工编号'); 返回false; } 别的{ if(table == null || table.length == 0){
("#idAttachmentsTable tr"); if(empNum < 6 || empNum > 10){ alert('Please provide employee number with digit range 6-10'); return false; } else{ if (table == null || table.length == 0){


这篇关于BtnSave点击事件+ CEWP + NewForm.aspx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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