I'm struggling to separate and assign the values returned by a function to different parameters.
function saveTaxes() {
$('input[type=checkbox]').each(function() {
if ($(this).is(':checked')) {
//test
console.log($(this).closest("tr").children("td").get()[0]);
console.log($(this).closest("tr").children("td").get()[1]);
console.log($(this).closest("tr").children("td").get()[2]);
//end test
var $row = $(this).closest('tr');
$('td', $row).each(function(i) {
var abc = $(this).text();
console.log(abc);
})
var params = {
"cuit": $("#cuit").val(),
"tax": i need the first val here,
"concept": and second here
};
$.ajax({
data: params,
url: 'api/insert_taxes.php',
type: 'post',
success: function(response) {
alert("Tax added.");
}
});
}
});
}