在Acrobat中,我希望根据第一个“描述”字段中选择的内容填充第二个“费率”字段。
我在线发现了一些代码,但不断获取:
SyntaxError:missing:属性id为2“。
我该如何解决这个问题?
这是我的代码:
var DeptData = {
S00170 Typesetting / Mechanicals: {
rate: "115.00"
},
S00174 Typesetting / Mechanicals: {
rate: "115.00"
},
S00178 File Verification & Creative Digital File: {
rate: "115.00"
},
S00182 Retouching / Image Editing: {
rate: "125.00"
},
S00194 Studio–CGI / Mac Illustration: {
rate: "125.00"
}
};
function SetFieldValues(cDescription) {
this.getField("rate1").value = DeptData[cDescription].rate;
}
答案 0 :(得分:0)
在定义DeptData
时,在描述中加上双引号应该可以解决问题。以下适用于我在Acrobat控制台中的作用:
var DeptData = {
"S00170 Typesetting / Mechanicals": {
rate: "115.00"
},
"S00174 Typesetting / Mechanicals": {
rate: "115.00"
},
"S00178 File Verification & Creative Digital File": {
rate: "115.00"
},
"S00182 Retouching / Image Editing": {
rate: "125.00"
},
"S00194 Studio–CGI / Mac Illustration": {
rate: "125.00"
}
};