Dynamically Adding Form Elements
Hi, I'm currently working on as per topic. I've taken the codes from
here.
It works perfectly but I need to add more fields than stated in the post.
If I add in another field, only one field gets the increment. The other doesn't.
Eg.
- <form id="myForm" method="get" action="test.php">
- <div id="input1" style="margin-bottom:4px;" class="clonedInput">
- Name: <input type="text" name="name1">
- Tel: <input type="text" name="tel1">
- </div>
-
- <div>
- <input type="button" id="btnAdd" value="add another name" />
- <input type="button" id="btnDel" value="remove name" />
- </div>
- <input type="submit" name="submit">
- </form>
What I get from the return GET is:
name1=123&tel1=123&name2=123&tel1=123&submit=Submit
The tel does not increase by 1. How do I edit the code to get what I want?
Thanks.