0
我有一個函數返回一行的值,但我不能將它們分開,並將它們放入不同的參數中。如何獲得一行的數據,如果複選框被選中
function guardarImpuestos() {
$('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 parametros = {
"cuit": $("#cuit").val(),
"impuesto": i need the first val here,
"concepto": and second here
};
$.ajax({
data: parametros,
url: 'api/insertar_impuestos.php',
type: 'post',
success: function(response) {
alert("Impuesto agregado.");
}
});
}
});
}
完善,解決 –
你能解釋一下什麼是錯的,你是如何解決它,所以大家不必做一個代碼比較瞭解? – Barmar
@Barmar良好的通話,更新。謝謝。 – JakeParis