Номер строки по пользователю: 3
Код: Выделить всё
| Col1 | Col2 |
|:----------|-------------:|
| dropdown0 | dropdownExc0 |
| dropdown1 | dropdownExc1 |
| dropdown2 | dropdownExc2 |
Код: Выделить всё
var rowNum = document.getElementById('rowCount').value;
for (var i = 0; i < rowNum; i++){
$('#dropdown' + i ).on("change", function () {
var requestid = $(this).val();
$.ajax({
type: "POST",
url: "req-exchange.php",
data: {req_id:requestid},
success: function (response) {
console.log(response);
$('#dropdownExc'+i).html(response);
}
});
});
}
Подробнее здесь: [url]https://stackoverflow.com/questions/78229338/ajax-php-dependent-dropdown-on-column-output-is-not-shown-when-put-increment-in[/url]
Мобильная версия