yea
This commit is contained in:
@@ -131,13 +131,6 @@ function openModal(productHref) {
|
|||||||
product = parts[parts.length - 2] || "Product";
|
product = parts[parts.length - 2] || "Product";
|
||||||
price = parts[parts.length - 1] || "0";
|
price = parts[parts.length - 1] || "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
product = product.replace(/_/g, "");
|
|
||||||
|
|
||||||
modal.querySelector('input[name="product"]').value = product;
|
|
||||||
modal.querySelector('input[name="price"]').value = price;
|
|
||||||
modal.querySelector("#productText").textContent = `You will buy ${product} for $${price}.`;
|
|
||||||
|
|
||||||
// Show/hide location select
|
// Show/hide location select
|
||||||
const locationSelect = document.getElementById("locationSelect");
|
const locationSelect = document.getElementById("locationSelect");
|
||||||
if (product.startsWith("_")) {
|
if (product.startsWith("_")) {
|
||||||
@@ -148,8 +141,14 @@ function openModal(productHref) {
|
|||||||
locationSelect.removeAttribute("required");
|
locationSelect.removeAttribute("required");
|
||||||
locationSelect.value = ""; // reset
|
locationSelect.value = ""; // reset
|
||||||
}
|
}
|
||||||
|
product = product.replace(/_/g, ""); // This needs to be after the locationSelect show ;)
|
||||||
|
|
||||||
|
modal.querySelector('input[name="product"]').value = product;
|
||||||
|
modal.querySelector('input[name="price"]').value = price;
|
||||||
|
modal.querySelector("#productText").textContent = `You will buy ${product} for $${price}.`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function handleFormSubmit() {
|
function handleFormSubmit() {
|
||||||
const form = document.getElementById("buyForm");
|
const form = document.getElementById("buyForm");
|
||||||
const confirmation = document.getElementById("confirmation");
|
const confirmation = document.getElementById("confirmation");
|
||||||
|
|||||||
Reference in New Issue
Block a user