$('#form-upload :checkbox').click(function () {
var $this = $(this);
// $this will contain a reference to the checkbox
if ($this.is(':checked')) {
// the checkbox was checked
var sku_td = $('#sku').text()
var price_td = $('#price').text()
var quantity_td = $('#quantity').text()
$('#price').empty()
$('#quantity').empty()
var sku = $('<input type="hidden" name="sku[]" value="' + sku_td + '">')
var price = $('<input type="text" name="price[]" value="' + price_td + '">')
var quantity = $('<input type="text" name="quantity[]" value="' + quantity_td + '">')
$('#sku').append(sku)
$('#price').append(price)
$('#quantity').append(quantity)
} else {
// the checkbox was unchecked
// undo every you did when you clicked the event
}
});
$('#form-upload :checkbox').click(function () {