增加水灯节表单 恢复余量信息

master
黄文强@HWQ-PC 11 months ago
parent ccfc82551f
commit 7f74d2b195

@ -4,8 +4,8 @@
<form id='ticket_form' action="https://www.asiahighlights.com/orders/lantern_save" method="post" >
<p style="font-size: 22px;"><strong>Select Date:</strong></p>
<div class="selectHotl" style="margin-bottom: 20px;" id="ticket_date_november15th">
<div class="optionLable">
<div class="selectHotl" style="margin-bottom: 20px;" >
<div class="optionLable" id="ticket_date_november15th">
<input type="radio" value="2024-11-15" checked id="november15th" name="ticket_date">
<label for="november15th">
November 15th, 2024
@ -23,42 +23,39 @@
<p style="font-size: 22px;"><strong>Select a Ticket Type:</strong></p>
<div class="selectHotl" style="margin-bottom: 20px;">
<div class="optionLable" id="ticket_type_premium_khomloy">
<input type="radio" value="Premium+Transfer+Dinner" checked id="premium_khomloy" data-price="199" name="ticket_type">
<input type="radio" value="Premium+Transfer+Dinner" checked id="premium_khomloy" data-price="179" name="ticket_type">
<label for="premium_khomloy" style="font-size:18px;">
Premium+Transfer+Dinner
<div class="selectionMemo">
US$199
US$199 (6400THB)
</div>
</label>
</div>
<div class="optionLable" id="ticket_type_vip_khomloy">
<input type="radio" value="VIP+Transfer+Dinner" id="vip_khomloy" data-price="179" name="ticket_type">
<input type="radio" value="VIP+Transfer+Dinner" id="vip_khomloy" data-price="169" name="ticket_type">
<label for="vip_khomloy" style="font-size:18px;">
VIP+Transfer+Dinner
<div class="selectionMemo">
US$179
US$179 (5900THB)
</div>
</label>
</div>
<div class="optionLable" id="ticket_type_standard_khomloy">
<input type="radio" disabled value="Standard+Transfer+Dinner" id="standard_khomloy" data-price="139" name="ticket_type">
<input type="radio" disabled value="Standard+Transfer+Dinner" id="standard_khomloy" data-price="129" name="ticket_type">
<label for="standard_khomloy" style="font-size:18px;">
Standard+Transfer+Dinner
<div class="selectionMemo">
Sold out
</div>
</label>
</div>
<div class="optionLable" id="ticket_type_premium_heritage" style="display: none;">
<!-- <div class="optionLable" id="ticket_type_premium_heritage" style="display: none;">
<input type="radio" value="Premium service+Exclusive Hotel Transfer+Dinner" id="premium_heritage" data-price="159" name="ticket_type">
<label for="premium_heritage" style="font-size:18px;">
Premium service+<strong>Exclusive Hotel Transfer</strong>+Dinner
<div class="selectionMemo">
US$159
US$159 (5500THB)
</div>
</label>
</div>
@ -68,10 +65,10 @@
<label for="vip_heritage" style="font-size:18px;">
VIP Service+Shuttle Transfer+Dinner
<div class="selectionMemo">
US$109
US$109 (3900THB)
</div>
</label>
</div>
</div> -->
</div>
<div id="ticket_type_errmsg" style="display: none">
@ -94,7 +91,7 @@
<input class="minaddBtn addadult" id='plusButton' type="button" value="+">
</div>
</div>
<div class="payonline_price">Total price: <strong id="totalPriceText">$139</strong></div>
<div class="payonline_price">Total price: <strong id="totalPriceText">$129</strong></div>
<p style="margin-top: 50px;"><strong>Please provide correct personal info. Double check.</strong></p>
<input class="FullName" id="ticket_realname" name="fullname"
@ -413,6 +410,55 @@
var ticket_date_november15th = document.getElementById("ticket_date_november15th");
var ticket_date_november16th = document.getElementById("ticket_date_november16th");
ticket_date_november15th.addEventListener('click', function () {
addStyledLabel("ticket_type_premium_khomloy", "60 left");
addStyledLabel("ticket_type_vip_khomloy", " 135 left");
addStyledLabel("ticket_type_standard_khomloy", "Sold out");
});
ticket_date_november16th.addEventListener('click', function () {
addStyledLabel("ticket_type_premium_khomloy", "240 left");
addStyledLabel("ticket_type_vip_khomloy", " 155 left");
addStyledLabel("ticket_type_standard_khomloy", "30 left");
});
function removeExistingLabels(targetId, labelClass) {
var target = document.getElementById(targetId);
if (target) {
var labelsToRemove = target.querySelectorAll('label.' + labelClass);
labelsToRemove.forEach(function(label) {
target.removeChild(label);
});
} else {
console.error('Element not found for ID:', targetId);
}
}
document.addEventListener('DOMContentLoaded', function () {
// 手动调用处理显示的函数
function initDefaultSelection() {
removeExistingLabels("ticket_type_premium_khomloy", "dynamic-label");
addStyledLabel("ticket_type_premium_khomloy", "(60)", "dynamic-label");
addStyledLabel("ticket_type_vip_khomloy", " (135)", "dynamic-label");
addStyledLabel("ticket_type_standard_khomloy", "Sold out", "dynamic-label");
}
// 调用初始化函数以设置默认显示
initDefaultSelection();
});
function addStyledLabel(targetId, text, labelClass) {
var target = document.getElementById(targetId);
if (target) {
removeExistingLabels(targetId, labelClass);
var label = document.createElement('label');
label.style.fontSize = '18px';
label.textContent = text;
label.classList.add(labelClass);
target.appendChild(label);
} else {
console.error('Element not found for ID:', targetId);
}
}
var venueList = document.querySelectorAll("input[name='Venue']");
var totalPriceText = document.getElementById("totalPriceText");

Loading…
Cancel
Save