jquery: on each click event append and increment input name -


each time button clicked need increment name='0fname' 1 php script sees unique name , not overwrite previous item.

$(document).ready(function(){     $('#addmember').click(function() {         (var = 0; <= 6; i++);          console.log("addmember called");         $("#addfammember").append("<input type='text' name='0fname'>");     return false; }); 

add counter:

$(document).ready(function(){ var count=0;     $('#addmember').click(function() {         console.log("addmember called");         $("#addfammember").append("<input type='text' name='" + count + "fname'>");         count++;     return false; }); 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -