Der touristische Frühling in der Schweiz

Der touristische Frühling in der Schweiz

Der Frühling ist eine ideale Zeit, um die Schweiz zu entdecken. Die Temperaturen sind mild und angenehm, die Natur steht in voller Blüte und die grünen Landschaften laden zum Entspannen und Kraft tanken ein. Das Bergland ist ein ideales Ziel für Wanderfreunde. Die...
tag. Mews.Distributor( // Set Configuration ID of your booking engine. { configurationIds: ['c6c0470b-b6ec-47e6-878b-af86008df0f3'], }, // Add callback which will enable Submit button and open the Booking Engine Widget upon button click. function (api) { // Listen on submit and when user submits, open booking engine with given dates. const listenOnSubmit = () => { // Find the form in DOM and listen on submit. const form = document.getElementById('date-form'); form.addEventListener('submit', event => { // Don't use the default submit button behavior. We want to handle it ourselves. event.preventDefault(); // Get the dates from the date form. const { start, end, adultcount, childcount, vouchercode } = event.target.elements; const [startYears, startMonths, startDays] = start.value.split('-'); const [endYears, endMonths, endDays] = end.value.split('-'); const adult = parseInt(adultcount.value); const child = parseInt(childcount.value); const code = vouchercode.value; const startDate = new Date(startYears, startMonths - 1, startDays); const endDate = new Date(endYears, endMonths - 1, endDays); // Use the Booking Engine Widget Javascript API to set the dates in the widget and open it. api.setStartDate(startDate); api.setEndDate(endDate); api.setAdultCount(adult); api.setChildCount(child); api.setVoucherCode(code); api.open(); }); }; listenOnSubmit(); // Enable the submit button, because the Booking Engine Widget is ready to be used. const enableSubmit = () => { const submitButton = document.getElementById('dates-submit'); submitButton.value = 'Submit'; submitButton.disabled = false; }; enableSubmit(); } // 4. Note - this guide is written for the Production environment. );