gleeful-brioche-1c6a9a
custom domain Jasonstoll.live
Hi, I have finally resolved the issue of Netlify not recognizing my form. The form is now recognized. however, it does not receive any submissions.
See the below code on how I have it set up. I would appreciate any assistance in getting this figured out.
Thank you.
<template>
<div class="container">
<div class="column is-8 is-offset-2">
<form
name="subscribe"
id="myForm"
@submit.prevent="submitForm"
method="post"
data-netlify="true"
data-netlify-honeypot="bot-field">
<input type="hidden" name="form-name" value="subscribe" />
<p>
<label>Your Name: <input type="text" name="name" /></label>
</p>
<p>
<label>Your Email: <input type="email" name="email" /></label>
</p>
<p>
<label>Message: <textarea name="message"></textarea></label>
</p>
<p>
<button type="submit">Subscribe</button>
</p>
</form>
</div>
</div>
</template>
<script>
export default {
methods: {
submitForm() {
const myForm = document.getElementById ("myForm")
const formData = new FormData(myForm);
fetch("/", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded" ,
"Accept": "application/x-www-form-urlencoded" },
body: new URLSearchParams(formData).toString(),
})
.then(() => this.$router.push({path:'/thankyou'}))
.catch((error) => alert(error));
}
}
}
</script>