简体   繁体   English

Livecycle Designer:JS:按名称查找所有元素

[英]Livecycle Designer: JS: find all elements by name

I have a document in Adobe Livecycle Designer where I have multiple text fields named "Jahr1". 我在Adobe Livecycle Designer中有一个文档,其中有多个名为“ Jahr1”的文本字段。 They are scattered throughout the whole document. 它们分散在整个文档中。

Now I want to change the value of all those fields. 现在,我想更改所有这些字段的值。 For this I need to find all text fields with name "Jahr1". 为此,我需要找到所有名称为“ Jahr1”的文本字段。 I tried that like so: 我这样尝试过:

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

and also like this: 也是这样的:

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

But nodes remains empty. 但是nodes仍然是空的。

Any ideas? 有任何想法吗?

 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;
        } 
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM