Hello there,
I have an issue with the netlify form, no matter what I try I don’t see submissions.
So what I did was create an html file in the public folder with the form code like in the instruction.
form.html
<!DOCTYPE html>
<head></head>
<body>
<form name="contactForm1" netlify hidden method="POST">
<input type="text" name="name" placeholder="Name" />
<input type="email" name="email" placeholder="Email" />
<input type="text" name="subject" placeholder="Subject" />
<textarea name="message" placeholder="Message" rows="4" ></textarea>
</form>
</body>
</html>
And I have the real form and logic here in a component:
<form name="contactForm1" method="POST" @submit="handleSubmit">
<input type="hidden" name="form-name" value="contactForm1" />
<div class="controls row">
<div class="col-lg-6">
<div class="form-group mb-30">
<input type="text" name="name" placeholder="Name" required />
</div>
</div>
<div class="col-lg-6">
<div class="form-group mb-30">
<input type="email" name="email" placeholder="Email" required />
</div>
</div>
<div class="col-12">
<div class="form-group mb-30">
<input type="text" name="subject" placeholder="Subject" />
</div>
</div>
<div class="col-12">
<div class="form-group">
<textarea name="message" placeholder="Message" rows="4" required></textarea>
</div>
<div class="mt-30">
<button type="submit" class="butn butn-md butn-bord radius-30">
<span class="text">Let's Talk</span>
</button>
</div>
</div>
</div>
</form>
Submission script:
<script setup>
const handleSubmit = (event) => {
event.preventDefault();
const myForm = event.target;
const formData = new FormData(myForm);
fetch("/contact-us", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams(formData).toString(),
})
.then(() => navigateTo('/thank-you'))
.catch((error) => alert(error));
};
</script>
The submit script runs and redirects successfully, but nothing is showing up in the dashboard (I checked spam as well).
I also tried making this form work with the default submit (no script), same problem.
Link: Geekfolio - Contact
I would appreciate any help.