使用 Javascript 在 Adob​​e 中根据复选框执行操作

Perform Action Based on Checking Box in Adobe using Javascript

每当用户使用 Javascript 在 Adob​​e Acrobat Pro XI 中选中复选框时,我都试图更改文本框的值,但我对此缺乏经验。我在第 9 行收到语法错误错误:非法字符 7:基于以下代码:

//Checked
if (this.getField("myCheckBox").value != "Off") { 
this.getField("myTextBox").value = util.printd("mm/dd/yyyy HH:MM:ss", new  Date());

//Not Checked
} else { 
this.getField("myTextBox ").value = “”;
}

我觉得我需要以某种方式更改括号,谁能解释一下?

感谢您的帮助!

else 子句中的引号不是 "correct" 引号

  this.getField("myTextBox ").value = “”;  // <-- change these to ""

此外,可能需要删除 "myTextBox "

之后的白色-space

尝试...

  this.getField("myTextBox").value = "";