diff --git a/application/views/mobile_first/ah-tour-list-form.php b/application/views/mobile_first/ah-tour-list-form.php index 9f94f2f0..7c898d4c 100644 --- a/application/views/mobile_first/ah-tour-list-form.php +++ b/application/views/mobile_first/ah-tour-list-form.php @@ -520,29 +520,29 @@ document.addEventListener('DOMContentLoaded', () => { minDate: "today" }); - var quick_inquiry_button = document.getElementById("quick_inquiry_button"); - var quick_inquiry_form = document.getElementById("quick_inquiry_form"); - - quick_inquiry_button.addEventListener('click', function(event) { - var validateResult = validateQuickInquiryForm(); - if (validateResult) { - if (typeof(grecaptcha) === "undefined") { - console.warn('grecaptcha is disabled.'); - quick_inquiry_form.submit(); - } else { - grecaptcha.enterprise.ready(async () => { - const token = await grecaptcha.enterprise.execute('6Lf828MhAAAAANNetijCXKwW5ARyhcJ-b1Hhslja', {action: 'ADD_TO_CART'}); - var el = document.createElement("input"); - el.type = "hidden"; - el.name = "__grecaptcha_token__"; - el.value = token; - quick_inquiry_form.appendChild(el); - quick_inquiry_form.submit(); - quick_inquiry_button.innerText = "Submitted successfully"; - }); - } - } - }); + var tour_list_button = document.getElementById("tour_list_button"); + var tour_list_form = document.getElementById("tour_list_form"); + + tour_list_button.addEventListener('click', function (event) { + var validateResult = validateQuickInquiryForm(); + if (validateResult) { + if (typeof (grecaptcha) === "undefined") { + console.warn('grecaptcha is disabled.'); + tour_list_form.submit(); + } else { + grecaptcha.enterprise.ready(async () => { + const token = await grecaptcha.enterprise.execute('6Lf828MhAAAAANNetijCXKwW5ARyhcJ-b1Hhslja', { action: 'ADD_TO_CART' }); + var el = document.createElement("input"); + el.type = "hidden"; + el.name = "__grecaptcha_token__"; + el.value = token; + tour_list_form.appendChild(el); + tour_list_form.submit(); + tour_list_button.innerText = "Submitted successfully"; + }); + } + } + }); }); function validateQuickInquiryForm() {