-2

I have a form and a button with a function that create dynamically a textfield and set the name with an index like below: corso_1 corso_2 corso_3

So.. a php function get all the value of this form and add all in an array, so how can i get all the value into the dynamic textfields?

mastrobirraio
  • 135
  • 1
  • 9

1 Answers1

0

just put the all data with jquery in that dynamic textfield.by looping throught Real_data array and set index as Real_data['corso_'+i] and here i is a for loop variable.

& $('#corso') is the form id.

hope it helps.

  var data = $('#corso').serializeArray();
  var Real_data = {}; //this array is used to store sorted data
  $(data).each(function(i,field){
     Real_data[field.name] = field.value;
  });
Kunal Awasthi
  • 310
  • 2
  • 14