currently i was working with ajax jquery to post data to the php file, I use 'bootstrap selectpicker' to select list of guest which are loaded from the database
<select name="guest_hidden_id" id="guest_hidden_id"
class="selectpicker form-control input-sm guest_hidden_id"
data-live-search="true">
</select>
Below are javascript codes
$("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;
});
And below statement is how I capture the value
$guest_hidden_id = $_POST['guest_hidden_id'];
echo " Guest ID = ".$guest_hidden_id;