There is a addresses in my APP, there is a button that will add address if neccessary, but when I transfer the form to object and use ajax submit, the form object will only contain the last address. here is the demo
EDIT
this issue has been partial fixed, but we still think about if remove function is added, how we control the index of the list, if anyone has a good idea, you can give me a comment, thanks, and thank for the help from @weeksdev
The issue is that the input objects
name
is the same for all inputs. Modifying the name to iterate and all inputs show in output. Check this fiddle out for exampleHere is the correspoding code with the change:
Option 1:
Option 2:
If you are looking to get an array of objects with a
name
property then the corresponding code would be this:HTML:
JS:
Here is fiddle demonstrating option 2