Hi
Jono Moore was able to find an excellent solution from an original by Radzmar for targeting subforms throughout a form that share a name:
function hideSubs(vNode) {
if (vNode.className === "subform") {
//name of subform you're targeting
if (vNode.name === "targetSub") {
vNode.presence = "hidden";
}
}
for (var i = 0; i < vNode.nodes.length; i += 1) {
hideSubs(vNode.nodes.item(i));
}
}
hideSubs(xfa.form);
Has anyone any thoughts on how to extend this functionality to select the object within those subforms?
So: (1) find all subforms with the shared name (a solution above), then
(2) select all objects inside those subforms only (all types: text fields, radio buttons, check boxes, etc.).
The intention is to lock these down and to apply a colour change (from white to grey) as a visual cue. The solution above allows the background colour of the subforms to be changed, but what is required in this case is a colour change to the value backgrounds of the objects within those subforms only.
Any thoughts grately appreciated.
Thanks