Here is my html:
-
both Pevara and PSL scripts not working correctly
all new lines names/ids are same as first one so there is no way to get the values later from them in the script
.substring(index+9,1) should be corrected to .substring(index+9,index+10)
but even than next will be always ==2 as $person.html(); haven't been really changed
here are 3 solution options :
https://www.jqueryscript.net/form/jQuery-Plugin-To-Dynamically-Add-More-Form-Fields-czMore.html
https://www.codexworld.com/add-remove-input-fields-dynamically-using-jquery/
https://www.sanwebe.com/2013/03/addremove-input-fields-dynamically-with-jquery