These are my modifications to an existing plug-in I found although I do not remember where I found it.
If you take this you can take the numberof input that you would put in there and simply loop through the submissions. For instance you would create a div with the id of readroot, every input in there is going to be duplicated when the person clicks on the button to duplicate the actual div. You can create a button with onclick morefields() to execute the reproduction of the div. Then inside of your PHP file where you're collecting the posted data you can collect the numberof value and loop through, for instance, the code is below.
JQUERY:
var counter = 1;
function morefields() {
formClone = $('#readroot').clone(true);
$(formClone).css("display", "block");
counter++;
$(formClone).attr("name", 'readroot' + counter);
$(formClone).attr("id", 'readroot' + counter);
$(formClone).find("input, select, textarea").each(function() {
var s = $(this).attr("name")+counter;
var t = $(this).attr("id")+counter;
$(this).attr("name", s);
$(this).attr("id", t);
});
$("#writeroot").append(formClone);
var a = $(formClone).attr("id");
$('#numberof').val(counter);
}
PHP:
$number=$_POST['numberof'];
$num=0;
while($num <= $number){
$field=($num==0 ? $_POST['field'] : $_POST['field' . $num]);
$text=($num==0 ? mysql_real_escape_string($_POST['text']) : mysql_real_escape_string($_POST['text' . $num]));
$num++;
if ($num==1) { $num=2; }
}
This works great for me so hopefully this helps you a bit or shows you what else you can do!
class="required"on your new items and it should block any form from being submitted without the correct information filled in.