contact form for BroccoliWallet.com

This commit is contained in:
AJ ONeal 2018-05-04 23:23:16 -06:00
parent 50cbb8bbba
commit bf6d934cd0
1 changed files with 21 additions and 21 deletions

View File

@ -11,7 +11,7 @@
Name is optional and could be anything (it's just a text field for comments)
-->
<div class="js-contact-thanks">
<div class="js-contact-thanks" hidden>
Thanks! We'll be in touch soon!
</div>
<form class="js-contact-form" action="#">
@ -21,7 +21,7 @@
<br>
<label>Email:</label>
<input class="js-contact-name" type="email" required>
<input class="js-contact-email" type="email" required>
<br>
@ -36,25 +36,25 @@ function saveContact(name, email) {
email = email.toLowerCase().trim();
name = (name || '').trim();
return window.fetch('https://api.ppl.family/api/ppl.family/public/list', {
method: 'POST'
, cors: true
, headers: new Headers({ 'Content-Type': 'application/json' })
, body: JSON.stringify({ address: email, comment: 'Broccoli: ' + name })
}).then(function (resp) {
return resp.json().then(function (data) {
/*
if (data.error) {
window.alert("Couldn't save your contact. Email coolaj86@gmail.com instead.");
return;
}
*/
});
}, function () {
/*
window.alert("Didn't get your contact. Bad network connection? Email coolaj86@gmail.com instead.");
*/
});
return window.fetch('https://api.ppl.family/api/ppl.family/public/list', {
method: 'POST'
, cors: true
, headers: new Headers({ 'Content-Type': 'application/json' })
, body: JSON.stringify({ address: email, comment: 'Broccoli: ' + name })
}).then(function (resp) {
return resp.json().then(function (data) {
/*
if (data.error) {
window.alert("Couldn't save your contact. Email coolaj86@gmail.com instead.");
return;
}
*/
});
}, function () {
/*
window.alert("Didn't get your contact. Bad network connection? Email coolaj86@gmail.com instead.");
*/
});
}
window.document