The problem is this. It is necessary to add several data of the same type through the form (the number is not known in advance). Data has several properties. For example, "expenses": type, name, amount. Made a form with a table with input fields (input, select). The field names are set as follows.
<input type="text" name="charges[new][sum]"> <input type="text" name="charges[new][description]> Data is handled by php (as an array). I wanted to send several expenses at a time. I took a string with an input field and cloned it with jquery.
Is it possible to somehow easily change the index of the input fields ("new" change to "new2" or "new3", for example)?