$.ajax({
url: 'test.php',
type: "POST",
data: registerForm.serialize(), region: $("#regio option:selected").text(),
success: function(data) {
console.log(data)
}
});
現在我用這個我得到registerForm.serialize()
的所有數據,我可以叫他們test.php的與$_POST['the_name'];
傳遞值從Ajax調用PHP
現在我需要傳遞給test.php的$("#regio option:selected").text()
每當我在test.php中做echo $_POST['region']
它沒有看到區域屬性,我在裏面發送ajax到test.php。
如何將$("#regio option:selected").text()
傳遞給test.php並在test.php中調用它。