Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

How to get the handle of all text fields in the subforms, using script


Level 2
Hi Friends,

I have around 20 fields in a subform, how can i get the names of all the fields using script.

I wish to enhance the following script where the field names are hard coded

thereby the script itself will get the names of the field names.

var f1 = this.parent.somExpression + ".TextField2" + ",";

var f2 = f1 + this.parent.somExpression + ".DropDownList1" + ",";

var f3 = f2 + this.parent.somExpression + ".NumericField1";;

Any help will be greatly appreciated..


2 Replies


Level 10
Instead of using this.parent.somExpression (this gives you the somExpression for the container object) just use this.somExpression and that will give you the somExpression for the object.

If you want to keep your code the way it is you can also use to just get the object name.


Level 2
Hi Paul,

Thanks for your comments.

I achieved the clear contents by resetting, by taking input from your thoughts..

form1.sub1.sub2.sub3.table_1.addDelete_Top.addDelete.deleteRow::click - (JavaScript, client)


//Here is my code finally look like..

//row 1, table_1 are also subforms

for (var i=1;i<10;i++){

var myRow = this.resolveNode("table_1.row1[" + i + "]");

if(myRow.presence == "hidden"){

i = i-1;

var myRowDelete = this.resolveNode("table_1.row1[" + i + "]");


myRowDelete.presence = "hidden";





myRow.presence = "hidden";