我想从jQuery中的多个附加行中获取数据

时间:2019-02-22 04:42:57

标签: jquery

我通过jQuery附加行。现在,我需要从所有附加行中获取数据。我该如何实现?

$(function () {
  $('#cli').on('change', function () {
    var form = $('#edit-product');
    var x = $('#edit-product').serializeArray();
    var attributecolor = $(this).val(); //get value
    var configsku = $('#configsku').val(); //get value
    var configprice = $(this).val(); //get value
    var configqty = $(this).val(); //get value
    // Append data into #results div

    $("p1").append("<tr class='dop'><td>" + attributecolor + "</td><td><input type='text' name='configsku' id='configsku' placeholder='Add New Sku'></td><td><input type='text' name='configqty' id='configqty'  placeholder='Stock'></td><td><input type='text' tname='price' id='configprice' name='configprice' placeholder='Enter Price'></td><td><input type='text' name='sp-price' placeholder='Enter Special Price\'></td><td class='text-right'><i class='far fa-trash-alt del-table-add-sku'></i></td><br/></tr>");
    //$.post('Testsave.php', {configsku: configsku}, function(data){
    //$('#results').html(data);
  })

})

enter image description here

0 个答案:

没有答案