javascript - 在 Javascript 中为 Acrobat 存储和检索数据
问题描述
我有这个 PDF 表单,我正在编写脚本并有一个快速的问题。
我有一组复选框,如果选中某个复选框,我想存储数据并清除复选框,如果未选中,我想将值返回到以前的状态。
这是我到目前为止的代码:
if (groundingNV.value == "Yes"){
groundingGroundRodStore = groundingGroundRod.value;
groundingWaterPipeStore = groundingWaterPipe.value;
setNotRequired(["groundingGroundRod", "groundingWaterPipe"]);
clear(["groundingGroundRod", "groundingWaterPipe"]);
} else if (groundingGroundRod.value == "Yes" || groundingWaterPipe.value == "Yes"){
setNotRequired(["groundingGroundRod", "groundingWaterPipe", "groundingNV"]);
} else if (groundingNV.value == "Off"){
groundingGroundRod.value = groundingGroundRodStore;
groundingWaterPipe.value = groundingWaterPipeStore;
} else {
setRequired(["groundingGroundRod", "groundingWaterPipe", "groundingNV"]);
}
目前,如果我选中“groundingNV”框,其他值将被存储,如果未选中,它们将返回正确的位置;然而,他们然后被困在这里,我永远无法把他们带回来。
我尝试在 if else 语句的不同部分重新设置值,但它一直在做同样的事情。
我理解为什么它们会被卡住,但我不知道如何使它们以我正在寻找的方式运行。
任何投入将不胜感激!
解决方案
推荐阅读
- sql - 如何在某些条件下计算选定行中的值 - Potgresql
- python-3.x - 将多维numpy数组的元素转换为float32
- java - 使用@Transactional 注释的方法内部没有捕获异常
- javascript - 存储复杂对象并在不同状态下对其进行维护
- java - 如何使用在浏览器中打开的 java 下载 xml 文件?
- php - Laravel Elequent 模型错误:已达到最大函数嵌套级别,正在中止!”
- tensorflow - 如何在张量流 keras 中使用 CRF?
- javascript - 如何将javascript变量附加到html脚本标签?
- flutter - 实现始终具有 AppBar 和 BottomNavigationBar 的屏幕的最佳方法是什么?
- javascript - Reactjs 中针对多个事件的代码优化