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
BedrockMission!

Learn More

View all

Sign in to view all badges

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

Avatar

Avatar
Level 2
_jadobe_
Level 2

Likes

0 likes

Total Posts

18 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
_jadobe_
Level 2

Likes

0 likes

Total Posts

18 posts

Correct Reply

0 solutions
View profile
_jadobe_
Level 2

28-01-2009

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";

xfa.host.resetData(f3);



Any help will be greatly appreciated..



Thanks

JJ

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

29-01-2009

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 this.name to just get the object name.

Avatar

Avatar
Level 2
_jadobe_
Level 2

Likes

0 likes

Total Posts

18 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
_jadobe_
Level 2

Likes

0 likes

Total Posts

18 posts

Correct Reply

0 solutions
View profile
_jadobe_
Level 2

29-01-2009

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 + "]");

if(i!=0){

xfa.host.resetData(myRowDelete.somExpression);

myRowDelete.presence = "hidden";

}

break;

}

if(i==9){

xfa.host.resetData(myRow.somExpression);

myRow.presence = "hidden";

break;

}

}

//----------------------------------------------------------------



Thanks

JJ