Hi experts, please help me with a simple PHP doubt.
I have a simple form:
< form action="foo" >
< label >Person:< /label >
< input type="text" id="name" >
< input type="text" id="last_name" >
< a href="javascript:addmore();">Add More
< /form >
Every time the user clicks Add More two new input fields will be dynamically created using jQuery. This can be done several times in a same form.
< form action="foo" >
< label>Person:< /label >
< input type="text" id="name" >
< input type="text" id="last_name" >
< input type="text" id="name_2" >
< input type="text" id="last_name_2" >
< a href="javascript:addmore();">Add More
< input type="sbumit" >
< /form >
Each pair (name and last_name) should create on record in my db.
Two Questions:
1) What is the best option for input id? Appending a counter is the best option?
2) How can I handle it in the backend using php?
Let me know if you need more info.
Thanks in advance.