I have a form element which has data-netlify=âtrueâ. And I am already manually showing âYour form has been receivedâ message to user. Thereforce I dont need the following page:
What should I set for action attribute of form element to â do nothing , donât even scroll top or donât even move another page â I tried to action="/". It is refreshing the page.
I donât have AJAX here. I have just a div element and sending âForm Submittedâ text there when form submitted (with basic Javascript commands). When I remove action attribute Itâs showing the page that I shared with picture.
I did please try again. But as I said it was like this (without action attribute) when I created this support post. So It was sending user to âThank you! Your form submission has been received.â content of default netlify success page.
Create a success page (e.g. called thank-you) and set this as the action value so users see this page and not the default Thank You page.
OR
Incorporate the code currently used into the code below (from the documentation previously linked) so that the form submits using AJAX and therefore will no redirect.
Hi there, Iâve been trying to get this to work, but even though it submits, the server returns a â404â error, and I do not see the form data submitted in the Netlify control panel. How do we submit a form with AJAX so that Netlify recieves the data?
Figured it out. Unfortunately neither the docs nor the answers in this thread explain that you need to add this field to your form:
Hiya, sorry you are having trouble getting your forms to work.
This Support Guide is the first port of call to debug any forms issues. Please start here and work through these resources!
We also recommend trying to search the forums or look at topics tagged Netlify forms if you havenât already - itâs likely your question was already asked by someone else!
If you are still having problems, please provide more information such as what you have already tried, and a link to your live form.