I made several input field boxes with the following code:
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){
$('.add').click(function(){
par_id=$(this).parent().attr('id');
count=$("#"+par_id+"> input").length;
id=par_id.toString();
$(this).parent().append("<br/><input type='text' id='"+id+"'>");
});
});//]]>
</script>
I'm using the aforementioned code in order to create input fields that can dynamically add new fields.
This code creates multiple identical form ids, but I want it to create multiple identical form names so I can output it altogether using the foreach command.
Now I want to output the input data into a PHP using this
<?php
foreach($_POST['formid'] as $value) {
echo "$value <br />";
}
?>
What I want to ask is that the foreach command will only output data from the form name, but the javascript code I am using creates more input forms by the form id, not the form name.
So I need a code that will create more input boxes with form name, not form id!
I'm not sure how to modify the original code, since I got it from another website.
Please help!