Ways to hanlde multiple dynamic input fields in form
Newbie jquery/html form question -- I have a set of input fields that can be dynamically duplicated/cloned or removed and submitted. I'm looking for a ways to configure the form for easy processing without having to loop through each input field inside the divs:
<form action="dummy.php" method="post">
<div id="customer1">
Name: <input type="text" name="name1">
Addr: <input type="text" name="addr1">
Ph: <input type="text" name="phone1">
</div>
<div id="customer2">
Name: <input type="text" name="name2">
Addr: <input type="text" name="addr2">
Ph: <input type="text" name="phone2">
</div>
<div id="customer3">
Name: <input type="text" name="name3">
Addr: <input type="text" name="addr3">
Ph: <input type="text" name="phone3">
</div>
...
..
..
<a href="# id="addCustomer">+Add</a>
<input type="submit" value="Save">
</form>
I've also come across form input fields with name set to name[], addr[] and phone[] but doing so how do I map or combine all 3 inputs for determining a customer? Please advise.
Thanks!