Expand my Community achievements bar.

Repeating subform requires 'unique' global variable for each instance

Avatar

Level 2

I have a relatively complex form which contains a repeating subform which uses this javascript to take data entered into a text field and populate a global variable:

"PlanNameDisplay.rawValue

= this.rawValue; "

Since I need to use this information in multiple places within the somewhat complex subform, a global variable seemed to be the way to go.

Since I need to use this information in multiple places within the somewhat complex subform, a global variable seemed to be the way to go.

However, if the subform repeats, this global variable repeats in each successive subform when I need it to be unique to each subform instance. Is there a way to set a global variable in the subform such that it only repeats in that subform, and any successive subforms have their own unique global variables? I was thinking of somehow appending the field/variable name each time a new instance of the subform is created might do the trick but I'm not sure if this is the best way to do it, nor how to approach it if it is.

Any help would be greatly appreciated!

1 Reply

Avatar

Level 2

OK, I think I figured out a way to handle it - not sure if it is the best way.

Basically using the rawValue and scripting each field separately via:

TextField2.rawValue = TextField1.rawValue

and each instance maintains its own uniqueness.