diff --git a/haus-schleusingen.html b/haus-schleusingen.html index 1daeb5e..7ecedfc 100644 --- a/haus-schleusingen.html +++ b/haus-schleusingen.html @@ -527,7 +527,7 @@

Vielen Dank für Ihre Anfrage!


- Wir melden uns schnellstmöglich bei Ihnen. + Ihr E-Mail-Programm wurde geöffnet. Bitte senden Sie die E-Mail ab, damit Ihre Anfrage bei uns eingeht.
diff --git a/js/haus-schleusingen.js b/js/haus-schleusingen.js index cedb084..3b9d6ef 100644 --- a/js/haus-schleusingen.js +++ b/js/haus-schleusingen.js @@ -71,14 +71,33 @@ $(function () { } }); - // Form submit + // Form submit – opens email client with pre-filled mailto: link $("#contactForm").on("submit", function (e) { e.preventDefault(); - var btn = $(this).find(".btn-submit"); - btn.text("Wird gesendet...").prop("disabled", true); - setTimeout(function () { - $("#contactForm").hide(); - $("#formSuccess").fadeIn(400); - }, 1200); + + var fname = $("#fname").val().trim(); + var lname = $("#lname").val().trim(); + var email = $("#email").val().trim(); + var phone = $("#phone").val().trim(); + var interest = $("#interest").val(); + var message = $("#message").val().trim(); + + var subject = "Kontaktanfrage: " + interest; + var body = "Von: " + fname + " " + lname + "\n"; + body += "E-Mail: " + email + "\n"; + if (phone) body += "Telefon: " + phone + "\n"; + body += "Anliegen: " + interest + "\n\n"; + body += message; + + var mailto = + "mailto:mki@kies-media.de" + + "?subject=" + encodeURIComponent(subject) + + "&body=" + encodeURIComponent(body); + + window.location.href = mailto; + + // Show success message + $("#contactForm").hide(); + $("#formSuccess").fadeIn(400); }); });