Это мой HTML-код
Код: Выделить всё
Kota/Kabupaten
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belgium
Belize
Benin
Код: Выделить всё
$('#frm_provinsi').on('change', function() {
var nilai = $(this).val();
console.log(nilai);
if (nilai !== '') {
$.post({
type: 'POST',
url: 'index.php',
data: { frm_provinsi: nilai },
contentType: 'application/x-www-form-urlencoded',
dataType: 'text',
})
.done(function(respon) {
console.log(respon);
// Tampilkan hasilnya di halaman web
$('#hasil').html('Provinsi: ' + respon.nama_provinsi);
})
.fail(function(xhr, status, error) {
console.log(xhr.responseText);
});
} else {
console.log('Nilai tidak boleh kosong');
}
});
Код: Выделить всё
var_dump($_REQUEST);
Подробнее здесь: https://stackoverflow.com/questions/793 ... tp-request
Мобильная версия