0

I've got a Gatsby.js project that is ran from Netlify. For a contact form I'm using Netlify's api.

The content is multilingual so I've got a contact page on /contact/ and /en/contact/ These obviously share the same code for a form. I've created a successful form submit page on /form-succes/ and /en/form-succes/

But when I'm on the Dutch side and I submit the form I see the url go to /form-succes for a split second, and then it goes (redirects?) to /en/form-succes

It runs well on a local env but not after build on Netlify.

Is this a Netlify issue or did I do something wrong?

This is part of the form:

var pathPrefix is, depending on the language / or /en/

<form
  name={"contact"}
  method="post"
  netlify-honeypot="bot-field"
  data-netlify="true"
  lassName="contact-forms"
  action={`${pathPrefix}form-succes`} // "/form-succes" or "/en/form-succes"
          >
   // input stuff
</form>
Tim
  • 861
  • 1
  • 12
  • 27

1 Answers1

0

I've ended up makeing two Netlify Forms. One for each language. The documentation as Netlify provides is does not work.

name={'${pathPrefix}-contact'} (use backticks)

Tim
  • 861
  • 1
  • 12
  • 27