How to update the multiple objects of array on single click?

Hi i’m making backtesting stimulator and

  1. I have a form to add leg
  2. list of legs (coming from an array of objects)

I have onchange event on each field and each leg can be edited. However, I don’t want to update the individual object of arrayList. I have to update every individual changes on single update button

i am unable to do is after i edit those legs i want to be able to update them all in on click of final update button and not have update for each leg form.

here is the code if you want

Unable to view your sandbox. I get an error of “Sandbox not found”.

If you want all the changes to happen on a single update button, then create a button that updates all of the legs at the same instead of using an onchange event for each field. I would have a single form for all the updates and use fieldset to contain the fields for each leg.

Could you check the link again ?

It works now. My advice is the same though.

I apologize i did not understand your advice. i need the user to be able to edit each leg that’s why I have onchange event on each leg. However onchange doesn’t update the array and I am unable to figureout how to update all the changed objects with in array all at once.
I made a minimal representation of what I am talking about. may be it should be easy to understand.