Expand my Community achievements bar.

Add or delete two row table with header

Avatar

Level 2

Hello,

I am designing a "Parts Acquisition" form to keep track of parts ordered in my auto repair shop.

I want to be able to "Add" and "Delete" rows at random, the table has two rows with a header right now.

I want to change this depending if the part has arrived or not. I want the table to expand or contract.

I have seen other examples to add rows and delete rows but they just add a row at the bottom and delete just the bottom row, I want to delete not just the bottom row but any row.

I have added "Add" and "Delete" buttons but they have no functionality yet. I need to make them work in the manner described above.

Thanks in advance

John

Link to the form so far:

https://acrobat.com/#d=atHrbAgKazgrQgmWhDKWAw

4 Replies

Avatar

Level 10

Hi John,

The easiest way to give a user the ability to delete a particular row is to include the delete button within the row.

There is a sample here: https://acrobat.com/#d=RZ1lzX23*u7L4N9rtWCYPQ

The thing to bear in mind:

  1. Form must be saved as dynamic
  2. Page or subform containing table must be set to flowed.
  3. addInstance has a parameter "1" or "true".
  4. removeInstance has a parameter for the instance number that you want to delete (zero-number based system).

You can also include buttons within the rows to move the row up or down.

Hope that helps,

Niall

Avatar

Level 2

Naill,

The second row needs to be added also not just the first row "Row1" because the notes and the checkboxes need to repeat also.

In my original table there was a header row and two rows below it those two rows need to repeat when the add button is pushed. I hope this makes sense.

I tried to figure this out on my own but I am lost.

John

Avatar

Level 10

Hi John,

I have put both rows in a group and repeat the group. All of the script now refers to the repeating group.

Updated sample here: https://acrobat.com/#d=3z4oDujiRjmAp-U0fDd1fg

or: https://acrobat.com/#d=J7Ns8HJuFMskRwUQv*618g

To be honest I think you would be better off with textfields in a repeating subform, instead of a table. It is easier to arrange the objects and is less temperamental.

Good luck,

Niall