how can I increment the input name and ID each time the element is inserted in the dom,
<input type="text" name="option_tree[sponsorship_section][1][image1]" id="sponsorship_section_image1_1">
to this:
<input type="text" name="option_tree[sponsorship_section][1][image2]" id="sponsorship_section_image1_2">
Thanks
Add a class to the element. In jQuery count the elements and store length in variable then you can use that variable to increment and insert in the DOM.