dForms has been shutdown
This commit is contained in:
parent
a2ddd6490f
commit
5779127565
|
@ -33,9 +33,7 @@
|
||||||
<form action="">
|
<form action="">
|
||||||
<p>WebDNS</p>
|
<p>WebDNS</p>
|
||||||
<p>API integrations for Route53, DNSSimple, Digital Ocean, and more.</p>
|
<p>API integrations for Route53, DNSSimple, Digital Ocean, and more.</p>
|
||||||
<p>Stay in the know:</p>
|
<p>
|
||||||
<p>Email: <input id="emailAddr" /></p>
|
|
||||||
<p><button class="fa mail-button" id="mailbtn"></button></p>
|
|
||||||
</form>
|
</form>
|
||||||
</main>
|
</main>
|
||||||
<footer>
|
<footer>
|
||||||
|
|
31
signup.js
31
signup.js
|
@ -1,31 +0,0 @@
|
||||||
var sent = false;
|
|
||||||
|
|
||||||
function signup() {
|
|
||||||
if (sent) return;
|
|
||||||
var email = emailAddr.value;
|
|
||||||
if (!validateEmail(email)) return;
|
|
||||||
mailbtn.classList.add("fa-clock");
|
|
||||||
mailbtn.classList.remove("mail-button");
|
|
||||||
mailbtn.blur();
|
|
||||||
console.log("Sending request...");
|
|
||||||
sent = true;
|
|
||||||
var req = new XMLHttpRequest();
|
|
||||||
req.onload = function () {
|
|
||||||
console.log(this.status + ": " + this.responseText);
|
|
||||||
mailbtn.classList.remove("fa-clock");
|
|
||||||
mailbtn.classList.add("fa-" + (this.status === 200 ? "check" : "times"));
|
|
||||||
};
|
|
||||||
req.open("POST", "https://wh.dforms.net/589550963468140574");
|
|
||||||
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
|
||||||
req.send("email=" + encodeURIComponent(email));
|
|
||||||
}
|
|
||||||
|
|
||||||
function validateEmail(email) {
|
|
||||||
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
||||||
return re.test(String(email).toLowerCase());
|
|
||||||
}
|
|
||||||
|
|
||||||
document.getElementsByTagName("form")[0].onsubmit = function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
signup();
|
|
||||||
};
|
|
Loading…
Reference in New Issue