clarnx
September 6, 2023, 9:32am
2
Hi @coaxial , thanks for the post.
You don’t have to change the url path for the fetch request. Once your application is hosted on Netlify, your form html with Netlify form configurations and AJAX is detected and it is properly handled to submit the forms.
You can also check the Netlify forum link below as the problem is similar to yours.
Hello,
I’m trying to set up a Netlify form to send messages from my site.
The form is working (messages are correctly submitted), but I can’t get the AJAX part to work.
On submit, I don’t want the user to be redirected to a thank you page. I want to display a Bootstrap alert with a success/error message under the form.
I have followed the official guidelines but I can’t remove the redirection. No matter what I do I keep on being redirected to Netlify’s default thank you page.
I have searche…
Also check the Netlify Support guides below.
https://answers.netlify.com/t/support-guide-i-dont-see-form-submissions-when-using-javascript/86/38
https://answers.netlify.com/t/support-guide-my-form-renders-with-javascript-but-wont-work-properly/87/29
If the above links don’t help, If possible can you share a code snippet or a repository for me to help with the debugging.
Thanks.