![](/img/trans.png)
[英]Livecycle Designer: JavaScript - find an element by name and position from the root
[英]Livecycle Designer: JS: find all elements by name
我在Adobe Livecycle Designer中有一個文檔,其中有多個名為“ Jahr1”的文本字段。 它們分散在整個文檔中。
現在,我想更改所有這些字段的值。 為此,我需要找到所有名稱為“ Jahr1”的文本字段。 我這樣嘗試過:
var nodes = xfa.resolveNodes("Jahr1[*]");
也是這樣的:
var nodes = xfa.resolveNodes("Jahr1");
但是nodes
仍然是空的。
有任何想法嗎?
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.