2

我在 Acrobat X pdf 表单中有 2 个互斥复选框。选中任一框需要隐藏一组文本字段。我已经为两个复选框分配了相同的 javascript,但只有在选中第一个框时才会隐藏这些字段。选中第二个框时没有任何反应。有任何想法吗?这是我使用的脚本(对javascript一无所知!):

var showHide = event.target.isBoxChecked(0) ? display.hidden : display.visible;

this.getField("Joint Address 1").display         = showHide;
this.getField("Joint City 1").display            = showHide;
this.getField("Joint State 1").display           = showHide;
this.getField("Joint Zip/Postal Code 1").display = showHide;
this.getField("Joint Country 1").display         = showHide;
4

1 回答 1

1

Acrobat 文档表明“isBoxChecked”的参数实际上是如果有多个具有相同名称的复选框时要处理的复选框的索引。

这意味着将“0”更改为“1”作为参数值可以让您解决其他复选框并解决问题

于 2012-12-20T15:48:00.887 回答