I have a form i want to get datas from.
I have 3 input fields to clone. I use reCopy.js (Jquery) plugin to clone my input fields.
I manage to process the form doing this :
foreach($HTTP_POST_VARS as $key => $value) {echo “$key => $value <br>”;}
What failed is that i’m not able to get the cloned field values because they all have he same name.
Can someone sort it out for me?
If you’re familiar to php, it should take a couple of minutes 😉
see the url of the form attached.
example of the plugin here : http://www.9lessons.info/2010/04/jquery-duplicate-field-form-submit-with.html
———————————————————————-
HERE THE PLUGIN
———————————————————————-
<script type=”text/javascript” src=”./js/reCopy.js”></script>
<script type=”text/javascript”>
$(function(){
var removeLink = ‘ <a class=”remove” href=”#” onclick=”$(this).parent().slideUp(function(){ $(this).remove() }); return false”><img src=”img/global/boutons/retrait.png” alt=”ajouter”> Effacer cette ligne</a>’;
$(‘a.add’).relCopy({ append: removeLink});
});
</script>
<script type=”text/javascript”>
$(document).ready(function() {
$(‘#btnAdd’).click(function() {
var num = $(‘.clonedInput’).length;
var newNum = new Number(num + 1);
var newElem = $(‘#input’ + num).clone().attr(‘id’, ‘input’ + newNum);
newElem.children(‘:first’).attr(‘id’, ‘name’ + newNum).attr(‘name’, ‘name’ + newNum);
$(‘#input’ + num).after(newElem);
$(‘#btnDel’).attr(‘disabled’,”);
if (newNum == 5)
$(‘#btnAdd’).attr(‘disabled’,’disabled’);
});
$(‘#btnDel’).click(function() {
var num = $(‘.clonedInput’).length;
$(‘#input’ + num).remove();
$(‘#btnAdd’).attr(‘disabled’,”);
if (num-1 == 1)
$(‘#btnDel’).attr(‘disabled’,’disabled’);
});
$(‘#btnDel’).attr(‘disabled’,’disabled’);
});
</script>
———————————————————————-
HERE MY CODE
———————————————————————-
<p class=”clone”>
<label for=”date”>Date<input name=”date[]” type=”date” id=”date” /></label>
<label for=”infos”>Date<input name=”infos[]” type=”infos” id=”infos” /></label>
<label for=”message”>Date<input name=”message[]” type=”message” id=”message” /></label>
</div>
<a href=”#” class=”add” rel=”.clone” >CLONE IT</a>
———————————————————————-
MY QUESTION : What is the php script able to get infos from those fiels including cloned fiels… ???
———————————————————————-
