We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7987074 commit a01009bCopy full SHA for a01009b
src/components/social/SocialSubscribe.astro
@@ -34,7 +34,7 @@ const socialLinks = [
34
</p>
35
36
<form
37
- onsubmit="handleSubscribe(event)"
+ id="subscribeForm"
38
class="flex flex-col sm:flex-row justify-center items-center gap-4"
39
>
40
<input
@@ -56,7 +56,10 @@ const socialLinks = [
56
</div>
57
58
<script>
59
- async function handleSubscribe(event) {
+ const form = document.getElementById("subscribeForm");
60
+ form?.addEventListener("submit", handleSubscribe);
61
+
62
+ async function handleSubscribe(event: SubmitEvent) {
63
event.preventDefault();
64
65
const input = document.getElementById("emailInput");
0 commit comments