【问题标题】:Livecycle Designer: JS: find all elements by nameLivecycle Designer:JS:按名称查找所有元素
【发布时间】:2014-10-16 03:36:19
【问题描述】:

我在 Adob​​e Livecycle Designer 中有一个文档,其中有多个名为“Jahr1”的文本字段。它们分散在整个文档中。

现在我想更改所有这些字段的值。为此,我需要找到名称为“Jahr1”的所有文本字段。我是这样尝试的:

var nodes = xfa.resolveNodes("Jahr1[*]");

还有这样的:

var nodes = xfa.resolveNodes("Jahr1");

nodes 仍然为空。

有什么想法吗?

【问题讨论】:

    标签: javascript adobe livecycle-designer


    【解决方案1】:
     form1.Subform2.Jahr1[0]::initialize - (JavaScript, client)
    
        // Access a field property using a field name. 
        // Change the field properties of a specific subform. 
        // Use the [] operator to access an object's property.
    
        // First, get the subform nodes. 
        var oNodes = Subform2.nodes; 
        var nNodesLength = oNodes.length; 
    
        // Loop through the subform's nodes and look for fields. 
        for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount ++) { 
    
            // Set the field property. 
            if (oNodes.item(nNodeCount).name.substr(0,5) == "Jahr1") { 
    
              oNodes.item(nNodeCount).rawValue = nNodeCount;
            } 
        }
    

    【讨论】:

      猜你喜欢
      • 2016-06-08
      • 2011-08-15
      • 1970-01-01
      • 2018-07-30
      • 1970-01-01
      • 2014-09-19
      • 1970-01-01
      • 1970-01-01
      • 2020-04-13
      相关资源
      最近更新 更多