На отправку даю форму
<form action="javascript: submitRequestForm();">
<div class="form-group">
<input class="form-control" required placeholder="Ваше имя" value="" id="req_name" type="text">
</div>
<div class="form-group">
<input class="form-control" placeholder="Интересующий препарат" id="req_drug" value="" type="text">
</div>
<div class="form-group">
<input class="form-control" required placeholder="Телефон" id="req_phone" value="" type="text">
</div>
<div class="form-group">
<input class="form-control" placeholder="Комментарий" id="req_comment" value="" type="text">
</div>
<div class="clearfix"></div>
<button type="submit" class="btn btn-request btn-block">Отправить</button>
</form>
var submitRequestForm = function() {
$('#bronModal').modal('hide');
$('#thxModal').modal('show');
var json = JSON.stringify({
name: $("#req_name").val(),
drug: $("#req_drug").val(),
phone: $("#req_phone").val(),
comment: $("#req_comment").val()
});
var url = "http://search-apteki.ru/sendmail/index.php";
$.post(url,
json,
function(resp) {
console.log(resp);
}
);
}