I have a simple form and script that submits it. I want to disable the success message and keep users on the page. I thought e.preventDefault() would do that.
e.preventDefault() works in the context of an alert on an ajax submitted form. You may want to try using the sample here and see if that works: Forms setup | Netlify Docs
Hi @katrina-r , I edited the code slightly and realized that the same code works for one of my sites but not the other. They are deploying the same form.
I removed the hidden class from the submit button on both pages to manually submit. In neither case was I redirected. In the console I see “Form submission success”
I can’t help but think there are much better ways to track 404 page hits than by using Netlify Forms. First thought is to call a function (edge or lambda) that logs details to a data store.
This isn’t obviously a solution to the form issue.
Is the form recognised in the Netlify dashboard for the site that doesn’t work? Are the form fields the same in the dashboard and the page the form is on?
No, I don’t have access to the site (other than the front end) as I don’t work for Netlify.
I thought, as per the title of this thread and first post, the issue was the “success message”. Now you’re saying that it is not the issue, rather that you are not receiving submissions.
originally, yes. But now it’s a different issue. @jasiqli are you in Australia? I had a form submission on the second site come through 4 hours ago. I’m thinking it worked when you clicked the submit button.
I also tested using document.forms.notfound.submit() on both forms (this resulted in a redirect to the default “Thank You” page) so you may see numerous submissions in a short period of time.
so it does seem like there’s a bug here in Netlify. It triggers when you click the submit button but not with document.getElementById('submit-button').click();