I have setup a booking engine for a booking engine which uses a POST method – I have used a XDate library (which works great) my issue is that the booking engine should display the new page from the booking engine website after doing the POST.
I’ve added a jsbin link that illustrates the code
http://jsbin.com/ikowuk/1/
I am trying to implement the synxis booking engine similar to this site (albeit using jQuery)
http://www.stoneaston.co.uk/
function booking_engine(bookingObj)
{
$.post('https://gc.synxis.com/rez.aspx', {
'Chain': bookingObj.chain_id,
'lang': '1',
'locale': 'en-GB',
'step': '1',
'altdest': 'Country',
'Hotel': bookingObj.booking_id,
'arrive': bookingObj.start_date.uk_date,
'depart': bookingObj.end_date.uk_date,
'adult': bookingObj.adults,
'child': bookingObj.child,
'rooms': bookingObj.rooms
}, function(data) {
console.log(data);
});
}
As per my comment, just an option: you could make a form with the
hiddenattribute set.<form id="form1" action="https://gc.synxis.com/rez.aspx" method="POST" style="display: none;"><input id="submit" type="submit" value="Submit"></form>(or alternative to hide)
Then, instead of performing a jQuery
$.post(), you could set the hidden elements of the form to the values you wish to post. So, for your example, one of the hidden elements added to the form could be:$('#form1').append('<input name="booking_id" type="text" value="'+bookingObj.booking_id+'">');Once you’ve created all your hidden elements and appended them to the hidden form, you submit that form:
$('#submit').trigger('click');Once you trigger that click, all your data is then posted to your rez.aspx page and you also “go along with it”.