目前我正在使用ajax jquery将数据发布到php文件中, 我使用' bootstrap selectpicker'选择从数据库加载的来宾列表
<select name="guest_hidden_id" id="guest_hidden_id"
class="selectpicker form-control input-sm guest_hidden_id"
data-live-search="true">
</select>
以下是javascript代码
$("form#post-form").submit(function(event) {
event.preventDefault(event);
var formData = new FormData(this);
$.ajax({
url: 'inc/add_booking.php',
type: 'POST',
data: formData,
async: false,
success: function (response) {
alert(response);
},
cache: false,
contentType: false,
processData: false
});
return false;
});
以下陈述是我如何捕捉价值
$guest_hidden_id = $_POST['guest_hidden_id'];
echo " Guest ID = ".$guest_hidden_id;