Thanks for your patience - it turns out that is intended, even if not a well known feature. Sorry it tripped you up, and our documentation engineers are working on figuring out the right place to put that info into our docs.
This was working for me a half-hour ago, but then I decided to change from /contact-form-success to /contact-us/success, which I thought looked better.
My setup is as follows:
/contact-us.html (all post-processing is enabled, so the .html is truncated)
Thank you for your help, but my form is unfortunately still not working.
The oddest thing happens - my URL bar does indeed show that I have been redirected to /contact-us/success upon submission, but Netlify’s default Thank You page is rendered, rather than my website.
As for the link you posted, I believe that I am already doing what it suggests (if I’m not mistaken):
If you want to show your own content after the POST rather than our generic thank-you page, make sure you include an action=/path parameter in your form definition. ( /path should be the page you want to display - might be “/” or “/thank-you/english.html” - must be either ‘thank-you’ to use our automatic thank you page, or a path starting with / - but NOT a complete URL starting with http(s) ). While you wouldn’t seem to need an action for AJAX forms - it’s how we know what to show after submission, so you do need one unless you’d like us to show our thank-you page. If this path doesn’t exist, we will use our own standard thank-you page.
@fool correct however my netlify.toml file specifies the following redirect:
from = "/contact-us/success"
to = "/contact-us"
status = 200
force = true
As I was writing this post, I decided to try the one thing that had worked for me in the past, but at the time of my original post, was broken: redirecting to /contact-us#success. That now works, so I’m happy! /contact-us/success would be ideal, though, if I may be so bold.
So, the question is now: Is redirect functionality supported by Netlify Forms? I.e. even though /contact-us/success is not a “real” page per se, it is also not a 404 error and instead redirects to a real page.
If this functionality is not currently officially supported, might it possibly be in the future?
The requirement for the path in the ‘action’ attribute is that it needs to exist in your deploy. If you add a /contact-us/success path to your site, then that action should work. It can’t be a path that will be redirected. Is there a reason you can’t add the files to your deploy rather than a redirect rule?
I would like it to be the same exact page as the form’s, if possible, because the user can dismiss the modal, and JS makes the address bar return to /contact-us (removes /success or #success from the end).
So, in this case that users remain on the same page after submission, it seems kind of inefficient to have two copies of the same file at two different locations. Couldn’t this cause some problems, e.g. with Netlify Forms seeing my site having two forms, now, instead of one? Can Netlify “see” that they are identical and only store one copy of the page to serve as necessary?
Perhaps I can just have the success page be a full-page iFrame w/ a modal, if necessary?
Right now, the best solution to me seems to be using the same page with anchors, I guess.
Hello @suyash , I can tell it’s been a while since you posted this and got no feedback from @v1shnu.
If I may ask were you also able to resolve the issue.
If the problem persists kindly share a code snippet of your form for me to be able to assist you.