Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Dynamic input field generation
03-27-2012, 03:26 AM #1
- Join Date
- Mar 2012
- Thanked 0 Times in 0 Posts
Dynamic input field generation
I have a complicated (well to me it is!) problem with a form I am creating for my site. The form has three sections with the ability to add another field unlimited times. There is one for adding ingredients, one for equipment and one for steps
There is also another problem in that if I create say 3 steps bringing the count up to step4 and then remove the second step, I cant see how I can bring the other steps after step2 count down by one, at the moment step4 and step3 are staying as step3 and step4 but because step2 was removed they should drop down to becoming step2 and step3. My php that inserts the data into my db isnt working because the ids keep getting messed up
I have a demo URL up on ajburchell.com/form.html
If anyone can help me with this I will be extremely grateful
Thank you in advance
03-27-2012, 09:27 AM #2
- Join Date
- Dec 2010
- Thanked 558 Times in 551 Posts
First of all: Never ever use more than one instance of jQuery on the same page. You are using versions 1.3.2 and 1.6.4 together, which will create problems.
Second: You use the global "var current" several times. Each one overwrites the previous one in that case.
Despite this, when I add two new Ingredient areas and fill out number 3 for example, I can see from the POST request that it was correctly sent as ingredient3. So I don't see the problem