perry
May 5, 2022, 3:56pm
2
hi there sazncode,
totally get what you are saying, however, i don’t think having event.preventDefault();
is causing problems per se, this is a very common thing to do as having the page reload doesn’t provide a great user experience in most cases.
I’m wondering whether it might be something more foundational about your form setup.
Let’s have you look through here first to see if this helps?
Last reviewed by Netlify Support on May 25, 2022
I have a form rendered using JavaScript, but it’s not submitting. What’s going on?
There are a few things to consider when using JavaScript with a Netlify-handled form:
If you have rendered your form using JavaScript and are not using a Static Site Generator (or, your generator does not render it down to HTML such as Gatsby does), you will need to make sure you have a hidden, pure HTML version of your form somewhere in your site.
This means …
Last reviewed: August 2023
Fear not, there’s just a couple of extra things to make sure you have that will probably get things working!
The most frequent cause of problems with JS forms is that you (or your static site generator) need to create an HTML version of your form to match your JavaScript version. Some frameworks like gatsby/react may do this automatically, but the important part is that the HTML version MUST match what your JS submits exactly: same form name, and field names. You mu…
Last reviewed August 2023
Please give these debugging tips a try before making a new post. If none of the suggestions work, please include the information that we request at the end of this guide in the new post that you create. Thank you!
Why use Forms?
Forms are one of the most useful parts of modern websites because they allow us to capture input from our visitors.
There are many ways to use forms: contact forms, such as contact forms and sign-up forms. Seeing as there are many types of fo…
let us know if you can’t make it work even after working through these guides!