diff --git a/index.html b/index.html index fe1ab14..2ec4b90 100644 --- a/index.html +++ b/index.html @@ -289,7 +289,8 @@ - + +
Hint: The form is currently disabled because the site is stil under construction. It can still change.
@@ -359,7 +360,7 @@ document.getElementById('scroll-top').style.display = "none"; // check if site is released var timeToRelease = new Date('July 2, 2022 12:00:00').getTime() - new Date().getTime(); - if(timeToRelease > 0) window.location = "https://michivonah.ch/countdown.html"; + if(timeToRelease > 0 && window.location.hostname == 'michivonah.ch') window.location = "https://michivonah.ch/countdown.html"; // Instagram: https://www.instagram.com/vompictures/?__a=1 age(16, 09, 2005); toggleSocialmedia(); @@ -491,7 +492,9 @@ } } if(errorCount <= 0){ - document.getElementById("contact-form").submit(); + var name = document.getElementById('surname-field').value + " " + document.getElementById('lastname-field').value; + sendWhatsapp(name, document.getElementById('email-field').value, document.getElementById('subject-field').value, document.getElementById('message-text').value); + //document.getElementById("contact-form").submit(); } } @@ -516,8 +519,14 @@ else document.getElementById(imgId).src = old; } - function sendWhatsapp(){ - // https://wa.me/41782471516?text= + function sendWhatsapp(name, mail, subject, text){ + var mail = mail.replaceAll('@', '%40'); + var subject = subject.replaceAll(' ', '%20'); + var text = text.replaceAll(' ', '%20'); + var text = text.replaceAll('?', '%3F'); + var text = text.replaceAll('!', '%21'); + var whatsappUrl = "https://wa.me/41782471516?text=Name%3A%20" + name + "%0AE-Mail%3A%20" + mail + "%0ASubject%3A%20" + subject + "%0AMessage%3A%20" + text; + window.open(whatsappUrl); } function age(birthday, birthmonth, birthyear){