i want to post dynamically generated multiple text box using php by foreach loop. for instance i m working on question bank and for post multiple answer from php. here is my code that dynamically generated textbox but now i donot know how to post value of generated textbox thru foreach loop.
$("#questionbank").live('click',function(){
var mydata = '<div id="questionbank-content" class="page">';
mydata += '<div class="question"><div class="Label">Question</div><div class="textarea"><textarea id="question" rows="3" cols="30"></textarea></div></div><div class="answer"><div class="Label">Answer</div><div class="textarea"><textarea id="answer" rows="3" cols="30"></textarea></div><div class="option"><input id="a" name="answers" type="radio"></div><span id="add">Add</span>';
var i=1;
$('#add').live('click',function(){
j=i++;
$(this).after('<div class="Label">Answer</div><div class="textarea"><textarea id="answer + '+ j +'" rows="3" cols="30"></textarea></div><div class="option"><input id="a + '+ j +'" name="answers" type="radio"></div><span id="add">Add</span>');
//$(this).after('<input id="'+ j +'" type="text" value="'+ j +'"/><span id="add">Add</span>');
$(this).remove();
});
mydata += '</div></div>';
$("#leftcontainer").html(mydata);
});