【问题标题】:Java Sript Conditions for AcrobatDC/LiveCycle DesignerAcrobat DC/LiveCycle Designer 的 Javascript 条件
【发布时间】:2016-12-05 08:49:58
【问题描述】:

我在 Adob​​e LiveCycle Designer 中创建了可填写的 PDF(发票)。我想要自动填充字段值。

我的意思是我有 4 个不同的项目,它们具有不同的 Code 和不同的 Prices。 我必须询问两个字段Field1 called " ItemCode"Field2 called "UnitPrice"。我希望UnitPrice 字段自动填充ItemCode Price/Value

以下是商品代码及其价格:

018/22.50$

019/39$

020/16$

234/55 美元

我想要用于 Adob​​e LiveCycle Designer 和 Adob​​e Acrobat DC 的 JavaScript。

万分感谢。

【问题讨论】:

  • 您的问题有点不清楚,因为我认为是语言问题。您的意思是:用户必须填写两个字段(ItemCode 和 UnitPrice),然后 Field UnitPrice 应该自动填写 ItemCode/UnitPrice(并且 4 次)?或者您只是想在下拉列表中选择产品并在该 UnitPrice 字段中显示代码和价格?
  • 非常感谢您的回答,我想将 ItemCode 自己放在 Item Code 字段中,我希望价格会自动出现在 UnitPrice 字段中。 018 以上表示商品代码,22.50 美元是价格,所以,,,,,
  • 你的第二个答案在我的问题附近,我不想在 ItemCode 字段中的下拉列表我只想自己输入项目代码,并且该 ItemCode 的价格将出现在 UnitPrice 字段中

标签: acrobat livecycle-designer


【解决方案1】:

我会这样做(只是许多不同的可能性之一:

  1. 创建一个项目列表,每个项目对象都有两个属性 - idprice:(你也可以写 22.5 而不是 "22.50$" 但是你必须注意里面的格式UnitPrice 字段。

    var itemList = [
        {id:18,price:"22.50$"},
        {id:19,price:"39$"},
        {id:20,price:"16$"},
        {id:234,price:"55$"}
    ];
    
  2. 在您输入的字段的exit 事件中,您在id 中写入:

    var idEntered = parseInt(this.rawValue); 
    for (var i in itemList){
     if (itemList[i].id===idEntered){
      UnitPrice.rawValue = itemList[i].price;
      return;
     }
    }
    

如果您需要任何帮助来理解我的解决方案,请告诉我! :)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-16
    相关资源
    最近更新 更多