我在 Adobe Livecycle Designer 中有一个文档,其中有多个名为“Jahr1”的文本字段。它们分散在整个文档中。
现在我想更改所有这些字段的值。为此,我需要找到名称为“Jahr1”的所有文本字段。我尝试过这样:
var nodes = xfa.resolveNodes("Jahr1[*]");
还有这样的:
var nodes = xfa.resolveNodes("Jahr1");
但是节点
仍然为空。
有什么想法吗?
最佳答案
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;
}
}
关于javascript - 生命周期设计师: JS: find all elements by name,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25262926/