anchor.diff:                      stock: $(rows[i]).find('input[id="stock_level"]').val(),
                       preferred: $(rows[i]).find('input[id="main"]').prop('checked'),
                       files: $(rows[i]).find('input[id="file"]')[0].files,
  -                    main_picture: $(rows[i]).find('input[id="main_image"]').val()
  +                    main_picture: $(rows[i]).find('select[name="main_image"]').val()
                   });
                   colors_g[id].cur_id = colors_g[id].cur_id + 1;
  +                rows[i].dataset.changed = 'false';
               } else {
                   var item = get_correct(holder, parseInt(rows[i].dataset.idUse));
  -                colors_g[id].colors.push({
  -                    id: item.id,
  -                    title: $(rows[i]).find('input[id="title"]').val(),
  -                    price: $(rows[i]).find('input[id="price"]').val(),
  -                    color: $(rows[i]).find('input[id="code_hex"]').val(),
  -                    stock: $(rows[i]).find('input[id="stock_level"]').val(),
  -                    preferred: $(rows[i]).find('input[id="main"]').prop('checked'),
  -                    file: item.files,
  -                    main_picture: $(rows[i]).find('input[id="main_image"]').val()
  -                });
  +                if (rows[i].dataset.changed === 'true') {
  +                    colors_g[id].colors.push({
  +                        id: item.id,
  +                        title: $(rows[i]).find('input[id="title"]').val(),
  +                        price: $(rows[i]).find('input[id="price"]').val(),
  +                        color: $(rows[i]).find('input[id="code_hex"]').val(),
  +                        stock: $(rows[i]).find('input[id="stock_level"]').val(),
  +                        preferred: $(rows[i]).find('input[id="main"]').prop('checked'),
  +                        files: $(rows[i]).find('input[id="file"]')[0].files,
  +                        main_picture: $(rows[i]).find('select[name="main_image"]').val()
  +                    });
  +                    rows[i].dataset.changed = 'false';
  +                } else {
  +                    colors_g[id].colors.push({
  +                        id: item.id,
  +                        title: $(rows[i]).find('input[id="title"]').val(),
  +                        price: $(rows[i]).find('input[id="price"]').val(),
  +                        color: $(rows[i]).find('input[id="code_hex"]').val(),
  +                        stock: $(rows[i]).find('input[id="stock_level"]').val(),
  +                        preferred: $(rows[i]).find('input[id="main"]').prop('checked'),
  +                        file: item.files,
  +                        main_picture: item.main_picture
  +                    });
  +                    rows[i].dataset.changed = 'false';
  +                }
  +                console.log(colors_g[id].colors);
               }
           }
           console.log(colors_g[id]);
  
positive.code:         var files = $(parent).find('input[id="file"]')[0].files;
          var data_list = $(parent).find('#main_image_' + id)[0];
          console.log(data_list);
  
          var html = '';
  
  
negative.code:     }
  
      function new_color_row(id) {
          $(modal).find('#bonnie').replaceWith('<div class="color_row" data-ocupaid-use="false" data-changed="false" style="overflow: hidden; width: 100%; float: left;">\<n></n>' +
              '      <button onclick="remove_color_row(this)" style="float: left; width: 10%; margin: 0;">-</button>' +
              '      <input style="float: left; width: 12%; margin: 0;" value="" placeholder="Color title" name="title" id="title">\n' +
              '      <input style="float: left; width: 12%; margin: 0;" value="" step="any" type="number" placeholder="Price" name="price" id="price">\n' +
  