Change Onclick Event of sumbit button of sharepoint
function ModifyPendingFunction()
{
var currentPathname = location.pathname;
currentPathname = currentPathname.toLowerCase();
//Sing Form
if (currentPathname.indexOf('/signform.aspx') > 0)
{
var pending = $("input[id*=btnActions_Action1]");
if (pending.length>0) {
var strJS = pending.attr("onclick");
strJS = strJS.replace("javascript:", "");
pending.attr('onclick', '');
pending.click(function (e) {
if (!CheckCommentForPending())
{
e.preventDefault();
}
else {
new Function(strJS)();
}
});
}
}
}
function CheckCommentForPending(strJS)
{
var comment = $("textarea[id*=fld_Body]").val();
if (comment == "") {
alert("Please give your comment!");
return false;
}
else {
return true;
}
}
_spBodyOnLoadFunctionNames.push('ModifyPendingFunction');

浙公网安备 33010602011771号