我正在设计一个PDF表单(使用Adobe acrobat pro),它有一个下拉菜单和一个计算字段,其中包含一个取决于您从菜单中选择的选项的方程式,然后执行方程式 这是该文件的链接 Download here
var gf= this.getField("GF");
var tf= this.getField("TF");
var a= this.getField("fa");
if (this.getField("Dropdown7").value == "Ground floor")
{
a.value= gf.value;
event.target.display = display.visible;
}
if (this.getField("Dropdown7").value == "Mez")
{
a.value=gf.value*.75;
event.target.display = display.visible;
if (this.getField("Dropdown7").value == "Typical")
{
a.value= tf.value;
event.target.display = display.visible;
if (this.getField("Dropdown7").value == "last")
{
a.value= tf.value *.75;
event.target.display = display.visible;
}
我的问题,现在我在组件字段(下拉列表)中有大约75个选项,如果我按照我的方式操作,我最终得到的代码有75个if语句,我必须在75字段中修改它两次一个用于主计算领域和总数。
有更好的方法吗?