今天是个好日子,
在 adobe 表单中,我试图使用 2 个日期之间的差异来停止脚本......但我唯一能做的就是停止进行计算的函数而不是完整的脚本......
所以我在该脚本中有一个完整的“提交”脚本,我有以下两个日期之间的计算:
function ValidateCleanAndSubmit(){
var OffEndDate = GetFieldValue("official_endate");
var datearray = OffEndDate.split("-");
var EndDate = new Date(datearray[0],datearray[1] - 1,datearray[2]);
var DateDiff =
{
inDays: function(d1, d2)
{
var t2 = d2.getTime();
var t1 = d1.getTime();
if((parseInt((t2-t1)/(24*3600*1000))) > 7)
{
app.alert("The Official End Date is in more than 7 days therefore you cannot submit the form.\rPlease save the form and do it later (section 10).");
return false;
}
else
{
return true;
}
}
}
var d1 = new Date(EndDate);
var d2 = new Date();
DateDiff.inDays(d2, d1);
eformpdfSubmit();
}
它做了它应该显示错误消息但它继续运行完整的提交脚本......我怎样才能完全停止脚本运行......因为它基本上停止了非完整提交脚本中的“功能”。
谢谢你的帮助