title: jQuery - set input array values from array
body: <p><img src="https://i.stack.imgur.com/q0WJj.png" alt="form output image"></p>
  
  <p>The form have 3 variables: <code>useredu_id[]</code> <em>hidden type</em>, <code>useredu_qual[]</code> <em>select type</em>, <code>useredu_detail[]</code> <em>text box</em>.</p>
  
  <p>I try to set values to using JavaScript array which generated using jQuery ajax and the code is given below. But values are not stored</p>
  
  <pre><code>var xx = 0;
  var fieldHTML = ''
  + '&lt;div class="form-row field_group"&gt;' 
  + $(".field_group_copy").html() 
  + '&lt;/div&gt;';
  $.each(data.result_qual, function(key, val1) {
      var detail = data.result_detail[key];
      $('input[name="useredu_id[]"]').eq(xx).val(key);
      $('input[name="useredu_qual[]"]').eq(xx).val(val1);
      $('input[name="useredu_detail[]"]').eq(xx).val(detail);
      $('body').find('.field_group:last').after(fieldHTML);
      ++xx;
  });
  </code></pre>