Javascript功能在adobe acrobat中不起作用

时间:2013-12-19 07:11:18

标签: javascript adobe acrobat

以下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;
    }
}

1 个答案:

答案 0 :(得分:0)

对于初学者,我不会调用您的变量Date,因为它是JavaScript中日期对象的名称。我只想把它改成:

// lowercase 'date' doesn't conflict with 'Date' object
var date = this.getField( 'enrollDate' ).value;