fix: remove mailto handler and fix formSuccess element ID (refs #57, #58)
All checks were successful
Lint / PHP Syntax Check (pull_request) Manual approval
Lint / CSS Lint (stylelint) (pull_request) Manual approval
Lint / HTML Lint (htmlhint) (pull_request) Manual approval
Deploy Feature Branch to Test / deploy (push) Manual approval
Lint / PHP Syntax Check (push) Manual approval
Lint / CSS Lint (stylelint) (push) Manual approval
Lint / HTML Lint (htmlhint) (push) Successful in 1m12s
All checks were successful
Lint / PHP Syntax Check (pull_request) Manual approval
Lint / CSS Lint (stylelint) (pull_request) Manual approval
Lint / HTML Lint (htmlhint) (pull_request) Manual approval
Deploy Feature Branch to Test / deploy (push) Manual approval
Lint / PHP Syntax Check (push) Manual approval
Lint / CSS Lint (stylelint) (push) Manual approval
Lint / HTML Lint (htmlhint) (push) Successful in 1m12s
This commit is contained in:
@@ -177,39 +177,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
// Form submit is handled server-side by PHP – no JS intervention needed.
|
||||
// Form submit – opens email client with pre-filled mailto: link
|
||||
document.getElementById("contactForm").addEventListener("submit", function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var fname = document.getElementById("fname").value.trim();
|
||||
var lname = document.getElementById("lname").value.trim();
|
||||
var email = document.getElementById("email").value.trim();
|
||||
var phone = document.getElementById("phone").value.trim();
|
||||
var interest = document.getElementById("interest").value;
|
||||
var message = document.getElementById("message").value.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
|
||||
this.style.display = "none";
|
||||
var success = document.getElementById("formSuccess");
|
||||
success.style.display = "block";
|
||||
success.style.opacity = "0";
|
||||
success.style.transition = "opacity 0.4s ease";
|
||||
requestAnimationFrame(function () {
|
||||
success.style.opacity = "1";
|
||||
});
|
||||
document.getElementById("contactForm")
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user