ÖzgürKon 2021
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.
ozgurkon-2021-site/test-hugo/themes/devfest-theme-hugo/assets/script/subscription.js

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);
};
});