I am using jQuery UI Sortable for Drag/Drop re-ordering of rows in a table, and it's working fine.
However, the inputs in the rows have a counter which is their position in the table. They are of the format:
td
input(class="form-control itemDesc" type="text" name="items[0][desc]")
input(class="form-control rowQty" type="number" step="any" name="items[0][qty]" value="1")
etc..
I cannot change the formatting of this.
I will be passing a callback function to be run on the completion of the drag/drop, which checks the new position of the row in the table, and that will be my value to use to replace the [i].
How would I manipulate the number between the square brackets? How would I perform the replacement?