This commit is contained in:
2026-05-10 21:58:52 +02:00
parent 3ee0972888
commit cefca66094
2 changed files with 9 additions and 0 deletions

View File

@@ -34,10 +34,16 @@ document.addEventListener("DOMContentLoaded", () => {
.then(data => {
console.log("Success:", data);
document.getElementById("contact-form").innerHTML = `<p class="page-paragraph-success">Hvala za vaše sporočilo! Odgovorili vam bomo v najkrajšem možnem času.</p>`;
setTimeout(() => {
window.location.href = "/";
}, 3000);
})
.catch((error) => {
console.error("Error:", error);
document.getElementById("contact-form").innerHTML = `<p class="page-paragraph-error">Prišlo je do napake pri pošiljanju vašega sporočila. Prosimo, poskusite znova pozneje.</p>`;
setTimeout(() => {
window.location.href = "/";
}, 3000);
});
// TODO: Popravi margin pri success in error textu da ne bo offsetan

View File

@@ -65,6 +65,9 @@ document.getElementById("confirm-add").addEventListener("click", () => {
console.error("Error:", error);
document.getElementById("contact-form").innerHTML = `<p class="page-paragraph-error">Prišlo je do napake pri dodajanju vnosa. Prosimo, poskusite znova pozneje.</p>`;
});
setTimeout(() => {
window.location.href = "/";
}, 3000);
});
document.getElementById("cancel-add").addEventListener("click", () => {