forked from oyd/ozgurkon-2021-site
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
452 B
17 lines
452 B
6 years ago
|
// Subscription
|
||
|
$$('form.subscribe').forEach(formElt => {
|
||
|
console.log('subscribe', formElt);
|
||
|
formElt.onsubmit = () => {
|
||
|
const values = Array.from(formElt.elements)
|
||
|
.reduce(
|
||
|
(acc, elt) => {
|
||
|
if (elt.name) {
|
||
|
acc[elt.name] = elt.value;
|
||
|
}
|
||
|
return acc;
|
||
|
},
|
||
|
{});
|
||
|
subscribe(values);
|
||
|
};
|
||
|
});
|