Browse Source

contact form for BroccoliWallet.com

master
AJ ONeal 6 years ago
parent
commit
bf6d934cd0
  1. 42
      broccoliwallet.html

42
broccoliwallet.html

@ -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

Loading…
Cancel
Save