Home
Support Forums

Form action field not using custom success page

Netlify site name: open-legal-tech.netlify.app

Hey everyone,

I am unable to get the action attribute on a form to work. The form is found by netlify and the submissions are collected. Just the custom success page is not returned. The site is using nextjs. This is the source code of the form:

<form
   name="contact"
   method="POST"
   action="/contact-success"
   data-netlify="true"
   className={formCss()}
      >
        <input type="hidden" name="form-name" value="contact" />
        <Label htmlFor="name">Name</Label>
        <Input name="Name" id="name" />
        <Label htmlFor="email">E-Mail</Label>
        <Input required name="E-Mail" type="email" id="email" />
        <Label htmlFor="message">Nachricht</Label>
        <Input
          required
          name="Nachricht"
          as="textarea"
          rows={10}
          id="message"
        />
        <Button
          type="submit"
          variant="secondary"
        >
          Senden
        </Button>
      </form>

And this is the output on the page itself:

<form name="contact" method="POST" action="/contact-success" class="c-fFGpBB">
  <input type="hidden" name="form-name" value="contact" />
  <label for="name">Name</label>
  <input name="Name" id="name"/>
  <label for="email">E-Mail</label>
  <input
    type="email"
    required=""
    name="E-Mail"
    id="email"
    />
  <label for="message">Nachricht</label>
  <textarea
    required=""
    name="Nachricht"
    rows="10"
    id="message"
  ></textarea>
  <button
    type="submit"
  >
    Senden
  </button>
</form>

I have removed some classes for brevity and readability

The page I am targeting with the action does exist under the url https://open-legal-tech.netlify.app/contact-success. There are no redirects.

I already had a look at:

This is interesting. I checked your deploy and you don’t seem to have /contact-success page. Rather I found this:

/de/contact-success.html
/en/contact-success.html

Are you by any chance redirecting your action URL to the required page?

Thank you so much. That was exactly the issue. I did not even think about the translations, because they were left over and not in use anymore. This probably fixed future bugs as well.