workspace-pricing-en

// Funciones para manejar el modal function showModal(type, title, message) { var modal = document.getElementById('custom-modal'); var icon = document.getElementById('modal-icon'); var titleEl = document.getElementById('modal-title'); var messageEl = document.getElementById('modal-message'); if (type === 'success') { icon.innerHTML = '✔'; // Checkmark icon.className = 'modal-icon icon-success'; } else { icon.innerHTML = '✖'; // Cross icon.className = 'modal-icon icon-error'; } titleEl.textContent = title; messageEl.textContent = message; modal.classList.add('show'); } function closeModal() { var modal = document.getElementById('custom-modal'); modal.classList.remove('show'); } // Cerrar el modal al pulsar el botón OK document.getElementById('modal-close-btn').addEventListener('click', closeModal); // Envío del formulario document.getElementById("stackit-form").addEventListener("submit", function (event) { event.preventDefault(); var form = this; if (!form.checkValidity()) { form.reportValidity(); return; } var formData = new FormData(form); var urlEncodedData = new URLSearchParams(formData).toString(); var targetUrl = "https://cloud.mail.stackit.com/controller" fetch(targetUrl, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: urlEncodedData }) .then(function (response) { return response.text(); }) .then(function (responseText) { if (responseText.includes("SUCCESS")) { window.top.location.href = "https://schwarzdigits-workspace.com/en/pricing/thank-you"; } else { showModal('error', 'Error', 'Validation failed: ' + responseText); } }) .catch(function (error) { showModal('error', 'Error', 'Connection error while processing the form.'); }); });