This commit is contained in:
Archie Baer 2019-06-15 22:41:42 +01:00
parent 090ca3c2d6
commit c6878e5539
1 changed files with 3 additions and 5 deletions

View File

@ -4,7 +4,7 @@ function signup() {
if (sent) return; if (sent) return;
var email = emailAddr.value; var email = emailAddr.value;
if (!validateEmail(email)) return; if (!validateEmail(email)) return;
mailbtn.classList.add("fa-times"); mailbtn.classList.add("fa-clock");
mailbtn.classList.remove("mail-button"); mailbtn.classList.remove("mail-button");
mailbtn.blur(); mailbtn.blur();
console.log("Sending request..."); console.log("Sending request...");
@ -12,10 +12,8 @@ function signup() {
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
req.onload = function () { req.onload = function () {
console.log(this.status + ": " + this.responseText); console.log(this.status + ": " + this.responseText);
if (this.status) { mailbtn.classList.remove("fa-clock");
mailbtn.classList.remove("fa-times"); mailbtn.classList.add("fa-" + (this.status === 200 ? "check" : "times"));
mailbtn.classList.add("fa-check");
}
}; };
req.open("POST", "https://whserver.dforms.point0.tech/589550963468140574"); req.open("POST", "https://whserver.dforms.point0.tech/589550963468140574");
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");