I'm looking at this fiddle http://jsfiddle.net/yezw6c51/1/ which does what I need to do with one exception.
When you load it has one Input field named 'phone_number'
When you click on Add phone number
you can add multiple rows/input fields as such :
Each new input field that is added has had it's field name incremented. eg : phone_number1, phone_number2 etc. This works fine.
But I'd like the text before each input field to also have the incremented value adding as well, so you end up with :
So the text description is incremented with the same value as the phone_number field.
ie: Phone Number 2 = phone_number2 etc
How do I do that ?
Thanks
You can Use a Span After "Phone Number" in your HTML.
And make these changes in your script
check out here http://jsfiddle.net/yezw6c51/24/
Wrap your text with span
Then your can change only the text inside span
fiddle: http://jsfiddle.net/yezw6c51/16/
instead of giving each input different names, you can use name="phoneNumber[]" and loop through the post keys in backend. Demo: http://jsfiddle.net/artuc/yezw6c51/23/
HTML:
JS:
});