[英]Javascript function not working in adobe acrobat
Below javascript code is not working in adobe acrobat pro: 下面的JavaScript代码在Adobe Acrobat Pro中不起作用:
function CheckDate(){
var Date = this.getField("enrollDate").value;
var currentdate = new Date().getDate();
if(Date < currentdate){
app.alert("Date should be greater than");
}
else{
return false;
}
}
For starters, I wouldn't call your variable Date
, as that's the name of the date object in JavaScript. 首先,我不会调用您的变量
Date
,因为这是JavaScript中date对象的名称。 I would just change it to: 我只是将其更改为:
// lowercase 'date' doesn't conflict with 'Date' object
var date = this.getField( 'enrollDate' ).value;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.