Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

brackets and variables

Avatar

Level 2

What is the correct syntax for insert a variable into brackets?  I have the following java script.

----

var tcount = Subform2.instanceManager.count - 1

xfa.host.resetData("form1.Subform1.Subform2[tcount]");

----

tcount

returns 0 (checked with text field)

and

xfa.host.resetData("form1.Subform1.Subform2[0]");

properly executes a reset.

but

xfa.host.resetData("form1.Subform1.Subform2[tcount]");

fails

any ideas?

Thank you!

Tyler

1 Accepted Solution

Avatar

Correct answer by
Level 10

Since tcount is a variable you need to keep it outside of the double quotes.

xfa.host.resetData("form1.Subform1.Subform2[" + tcount + "]");

Thanks

Srini

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Since tcount is a variable you need to keep it outside of the double quotes.

xfa.host.resetData("form1.Subform1.Subform2[" + tcount + "]");

Thanks

Srini