Hi. I stopped receiving submissions suddenly. What could be wrong? On this earlier version i get submissions https://65b29943dd1e140008feec52--capable-longma-e26827.netlify.app/ but not on the newest https://65b7a99078801403fff371fa--capable-longma-e26827.netlify.app/ . I updated the domain for custom, could that be something to do with it? Didnt make any code changes
Here is the code:
const handleSubmit = (event: Event) => {
const formData = new FormData();
formData.append("form-name", "contact");
for (const key of Object.keys(form.value)) {
formData.append(key, (form.value as any)[key].value);
}
fetch("/", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams(formData as any).toString(),
})
.then(() => {
console.log("Form successfully submitted");
success.value = true;
})
.catch((error) => alert(error));
};
and here is the form:
<form
v-if="!success"
name="contact"
method="POST"
data-netlify="true"
netlify-honeypot="bot-field"
class="grid grid-cols-1 gap-6 md:pt-7 lg:gap-10 lg:pt-10"
@submit.prevent="handleSubmit"
>
<p class="hidden">
<label>
Don’t fill this out if you’re human: <input name="bot-field" />
</label>
</p>
<input type="hidden" name="form-name" value="contact" />
<FormInput
v-model="form.name.value"
:invalid-text="form.name.error"
label="Name"
name="name"
placeholder="Your name"
/>
<FormInput
v-model="form.email.value"
:invalid-text="form.email.error"
label="Email"
name="email"
placeholder="Your email"
type="email"
/>
<FormInput
v-model="form.message.value"
:invalid-text="form.message.error"
label="Message"
name="message"
placeholder="Write your message here..."
type="textarea"
/>
<button
type="submit"
class="flex justify-center w-full bg-accent-500 rounded-full py-3 text-lg font-semibold leading-[0.66] transition-colors duration-300 hover:bg-accent-600 lg:text-2xl"
>
Send
</button>