If you have in mind the part in facebook where you can add new education experiences or new jobs you will understand better what I am trying to do.
The user can click on "add new job" and new fieldsets are added to the form. Each fieldset contains various fields In the code there is always an empty fieldset with id #workfieldset_0 $("#workfieldset_0").hide(); // hide the empty fieldset $("#addnewjob").click(function() { //if user clicks the link to add var fromClone = $("#workfieldset_0").clone(); //clone empty fieldest $(fromClone).css("display", "block"); // make sure display is set to block and not hidden $("#appendhere").append(fromClone); // append the new fieldeset }); The problem is that my php script cannot obtain the data in the form because there are duplicate items (for example city[0], city[0] etc...). Of course it works fine without specifying the key (for example city[]...) but then I have other kind of conflicts with data that the user previously entered. What I need is that the all key arrays are replaced before the cloned fieldset is appended Any ideas?