cancel
Showing results for 
Search instead for 
Did you mean: 

Row Index

0 Kudos

Hi All,

I am new to Adobe Forms and Javascript, so please help me find the solution.

I have a table on the form and the row values will by dynamic. ie it could be either 2 or may be 10.

there is a button in 1 of the cells of the row. so each time the row is repeated, the button also repeats.

I need to find the row index of the button which is clicked.

Here is a sample code i am writing.

I have an attribute declared for index. CA_INDEX.

on button click:

formname.CA_INDEX.rawValue = formname.subform.table.data.button1.index;

I am able to find the total count though,

formname.CA_COUNT.rawValue = formname.subform.table.data.instanceManager.count;

Thanks in advance,

Regards,

Meep.

Accepted Solutions (1)

Accepted Solutions (1)

OttoGold
Active Contributor
0 Kudos

Maybe you could use relative addressing? If you use "this" in your script, it means the object which triggered the script. So if you place it on button, this means the button. Then you can move up and down in the hierarchy. Use this.parent (or field.parent) to access the arent node or just this.sub_x.field_y to access field_y wrapped in a su_x wrapped in your subform (here this is a subform, not a button).

Hope that makes sense. Although I am not sure it that fits with your task.

Regards Otto

0 Kudos

Thanks Otto.

It worked perfectly.

Solution:

var index = this.parent.index;

Answers (0)