Not being redirected to custom 'Thank you' page

Hi!

Form does work but I’m not being redirected to a custom Thank You page (I get default message). This is a pure javascript form, so I followed this approach: How to Integrate Netlify’s Form Handling in a React App | Netlify

I’ve added the action action="/thank-you" in the javascript form (which is the form users are going to interact with), as I guess is pointless doing so in the static HTML version, am I wrong?

Thanks in advance!

Could you help us with a URL to check?

Also, if it’s a pure JS form, I think you might also be submitting using AJAX? if yes, you could probably use location.href = '/thank-you and it should work too.

1 Like

Okay yeah, I think you might need the action attribute in the static version of your form too. Netlify parses the form during build time and only works with the form that’s available to the build bot during build time. Thus, any dynamically added stuff won’t work.

Could you add the attribute to the static version and let us know what happens?

2 Likes

That’s it! Thank you very much, hrishikesh!