Simulateur de volume de déménagement
Estimez votre volume en m³
0 m³
document.addEventListener("DOMContentLoaded", function () {
const button = document.getElementById("calcVolumeBtn");
const resultBox = document.getElementById("pvResult");
button.addEventListener("click", function () {
let total = 0;
document.querySelectorAll(".premium-volume input[type='number']").forEach(input => {
const qty = parseFloat(input.value) || 0;
const vol = parseFloat(input.dataset.vol) || 0;
total += qty * vol;
});
total = total.toFixed(2);
resultBox.textContent = total + " m³";
// Injection Fluent Forms
const fluentInput = document.querySelector("input[name='volume']");
if (fluentInput) {
fluentInput.value = total;
fluentInput.dispatchEvent(new Event("change", { bubbles: true }));
}
});
});