Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Getting subform names

Avatar

Level 2

Hi,

I have a main form and 15 sub forms, I want to display the all the 15 sub form names in a text field using javascript.

Can any one help on this?.

Thanks

Selva

2 Replies

Avatar

Level 10

Hi,

as long all the subforms are located in the same level of the forms hierachy a script like the following will do the job.

var oSubforms = Form1.resolveNodes("#subform[*]"),

    cSubformNames = "";

for (var i = 0; i < oSubforms.length; i += 1) {

cSubformNames += (oSubforms.item(i).name ? oSubforms.item(i).name : "unnamed Subform") + "\n";

}

Textfield1.rawValue = cSubformNames;