$("#FormBooking").submit(function (e) {
e.preventDefault();
var form_data = $(this).serialize();
$.ajax({
type: "POST", // Метод отправки
url: тут урл
data: form_data,
dataType: "html",
success: function (data) {
$('').html(тут html код модального окна);
},
error: function(data) {
alert("аааа");
}
});
})
$BtnBron = '<div class="butt_zabron"><input type="submit" id="button-buy' . $l . '" name="SubmitFPH" onclick="ajaxFormRequest();" class="button-buy" value="Бронь онлайн"><div class="br_hint">Оформление на сайте</div></div><div onclick="showFormBooking('.$l.');" id="sendTicket_'.$l.'" class="consult"><a>Отправить заявку</a><i class="fal fa-question-circle"></i><div class="za_hint">Мы перезвоним и оформим бронь по телефону.</div></div>';
$html1 = '<div class="result_rooms list_room"><form action="" method="POST" class="room" id="RoomForm"><input name="AccountRoomID" id="AccountRoomID'.$l.'" type="hidden" value="' . $Row['AccountRoomID'] . '"/><input name="RoomNameDef'.$l.'" id=\'RoomNameDef'.$l.'\' type="hidden" value="'.$RoomNameDef.'"/><input name="RoomName'.$l.'" id=\'RoomName'.$l.'\' type="hidden" value="'.$Row['RoomName'].'"/><input name="StartDate" type="hidden" value="' . $StartDate . '"/><input name="EndDate" type="hidden" value="' . $EndDate . '"/><input name="Adults" type="hidden" value="' . $Adults . '"/><input name="Children" type="hidden" value="' . $Children . '"/><input name="HotelID" type="hidden" value="' . $HotelID . '"/><input name="Source" type="hidden" value="rt.center"/><input name="Discount" type="hidden" value="' . $Discount . '"/><input name="ChildrenAges" type="hidden" value="' . $ChildrenAgeStr . '"/><input name="BonusType" id="BonusType' . $l . '" type="hidden" value="regular"/><div class="roomimg"><a title="Фотографии номера '.$Row['RoomName'].'" href="'.$ImageSrc.'" class="fancybox-buttons'.$l.'" data-lightbox="lightbox'.$l.'" class="buttons' . $l . '"><img src="' . $ImageSrcThumb . '" alt="Фото номера" class="roomtmb"></a></div><div class="roomdecr"><div class="name-room">' . $Row['RoomName'] . '</div><div class="description-room">В номере: ' . $RoomServices . '</div><div class="vmestim">' . $Place . '</div></div><div class="roomprice" id="roomprice' . $l . '">' . $Price_discount . $base_price . $IsNonRefundable . '</div>' . $BtnBron . '</form></div>';
function ajaxFormRequest(e) {
e.preventDefault();
alert(jQuery("#RoomForm").serialize());
$.ajax({
type: "POST",
url:"https://russ.travel/scriprts/testrt/booking.php",
dataType: "html",
data: jQuery("#RoomForm").serialize(),
success: function(data) {
$('body').html(data).show();
},
error: function(data) {
alert("error");
},
});
}
$BtnBron = '<div class="butt_zabron"><input type="submit" id="button-buy' . $l . '" name="SubmitFPH" onclick="ajaxFormRequest();" class="button-buy" value="Бронь онлайн"><div class="br_hint">Оформление на сайте</div></div><div onclick="showFormBooking('.$l.');" id="sendTicket_'.$l.'" class="consult"><a>Отправить заявку</a><i class="fal fa-question-circle"></i><div class="za_hint">Мы перезвоним и оформим бронь по телефону.</div></div>';
$html1 = '<div class="result_rooms list_room"><form action="" method="POST" class="room" id="RoomForm"><input name="AccountRoomID" id="AccountRoomID'.$l.'" type="hidden" value="' . $Row['AccountRoomID'] . '"/><input name="RoomNameDef'.$l.'" id=\'RoomNameDef'.$l.'\' type="hidden" value="'.$RoomNameDef.'"/><input name="RoomName'.$l.'" id=\'RoomName'.$l.'\' type="hidden" value="'.$Row['RoomName'].'"/><input name="StartDate" type="hidden" value="' . $StartDate . '"/><input name="EndDate" type="hidden" value="' . $EndDate . '"/><input name="Adults" type="hidden" value="' . $Adults . '"/><input name="Children" type="hidden" value="' . $Children . '"/><input name="HotelID" type="hidden" value="' . $HotelID . '"/><input name="Source" type="hidden" value="rt.center"/><input name="Discount" type="hidden" value="' . $Discount . '"/><input name="ChildrenAges" type="hidden" value="' . $ChildrenAgeStr . '"/><input name="BonusType" id="BonusType' . $l . '" type="hidden" value="regular"/><div class="roomimg"><a title="Фотографии номера '.$Row['RoomName'].'" href="'.$ImageSrc.'" class="fancybox-buttons'.$l.'" data-lightbox="lightbox'.$l.'" class="buttons' . $l . '"><img src="' . $ImageSrcThumb . '" alt="Фото номера" class="roomtmb"></a></div><div class="roomdecr"><div class="name-room">' . $Row['RoomName'] . '</div><div class="description-room">В номере: ' . $RoomServices . '</div><div class="vmestim">' . $Place . '</div></div><div class="roomprice" id="roomprice' . $l . '">' . $Price_discount . $base_price . $IsNonRefundable . '</div>' . $BtnBron . '</form></div>';
var pars = new Dictionary<string, dynamic>();
pars.Add("access_token", token);
...
var client = new HttpClient();
var json = JsonConvert.SerializeObject(pars);
var content = new StringContent(json);
var response = client.PostAsync(sendToListUrl, content);