Netlify Forms: Custom success message ignored due to invalid action parameter

Hi,

I’m not sure what I’m doing wrong, my custom success message isn’t being used, it seems to be ignored. Here’s my form.

<form name="contact" netlify-honeypot="bot-field" method="POST" action="/feedback/success/index.html" data-netlify="true">
  <input type="hidden" name="form-name" value="contact" />
  <p class="u-visually-hidden">
    <label>Don’t fill this out if you're human: <input name="bot-field"></label>
  </p>
  <label>What is your name?
    <input name="full-name" type="text" placeholder="Your full name" required>
  </label>
  <label>What is your email address?
    <input name="email-address" type="email" placeholder="Your email" required>
  </label>
  <label>What your message?
    <textarea name="message" type="text" placeholder="Your message..." required></textarea>
  </label>
    <button type="submit">Submit</button>
</form>

Can anyone offer a solution?

Thanks,

Dave

Hey Dave,

Take a look at our form debugging docs:

If that doesn’t help you find a solution, you’ll see the details we need (which is not your source code :)) to help you proceed with debugging, at the end of the article.

Almost all form troubles that are possible are covered in that article though, and we won’t be able to get back to you too quickly on this, so hopefully that can help you find a solution!

Thanks. I read that post before posting. That’s how I got the default message to work, but now I can’t get my custom message to work. I’ll keep trying, it’s possible I missed something. :slight_smile:

You could also send us the URL is your html form as requested and we’ll take a look, like it says there at the end :slight_smile:

Here’s the URL, https://www.davehill.dev/feedback/

Form name is contact.

I’ve made changes to the form since what I provided earlier. I’m still seeing the standard thank you for submitting though.

<form name="contact" method="POST" action="/success" enctype="application/x-www-form-urlencoded" netlify-honeypot="bot-field" data-netlify-recaptcha="true" data-netlify="true">
  
  <input type="hidden" name="form-name" value="contact">

  <p class="u-visually-hidden">
    <label>Don’t fill this out if you're human: <input name="bot-field"></label>
  </p>
  
  <label for="name">What is your name?
    <input name="name" type="text" required>
  </label>
  <label for="email">What is your email address?
    <input name="email" type="email" required>
  </label>
  <label for="message">What your message?
    <textarea name="message" required></textarea>
  </label>
  <div data-netlify-recaptcha="true"></div>
  <p>
    <button type="submit">Send</button>
  </p>
</form>

Can the active form called contact be deleted from my site? I think it’s causing a problem.

If it’s active, it cannot be deleted.

Try changing the name in the form you are using to a new name if you think the old one is interfering :slight_smile:

When I took a quick look at the html version of your form, I saw that this also is in violation of the suggestions on the debugging page:

<form name=contact method=post action=https://www.davehill.dev/success ...

  • action should be a path starting with /, not a URL.

Thanks for that @fool, I investigated why the full URL was being added and found that it was because I’d set canonifyurls to true in my Hugo config.

It’s working now. :grin:

Hello. I’m getting the same issue and can’t seem to figure it out.

<form
      name="contact"
      netlify-honeypot="bot-field"
      method="POST"
      action="/contact/thanks"
      data-netlify="true"
    >
      <input type="hidden" name="form-name" value="contact" />
      <div class="inputText">
        <label>Name</label>
        <br />
        <input type="text" name="name" class="marginbtm" />
      </div>
      <div class="inputText">
        <label>Email</label>
        <br />
        <input type="email" name="email" class="marginbtm" />
        <br />
      </div>
      <div class="inputText">
        <label>Message</label>
        <br />
        <textarea name="message" class="marginbtm"></textarea>
      </div>
      <button type="submit">送信する</button>
    </form>

Redirect is working, and I’m pretty sure I’ve deployed my own custom thank you page which is “/contact/thanks”, but it still redirects to the default Netlify thank you page. Any tips on troubleshooting?

Just fyi, I’ve already checked this page and I think I’m doing everything it says here.

In the post you reference, we ask some very specific questions at the end of it. Please answer those questions so we can help you troubleshoot from there.

Hello, sorry about that.

  1. The URL for your live form as you want visitors to use it
    Bored of Plastic

  2. The URL of your deployed html form (in case you have a javascript form, we need to literally be linked to the html version you’ve deployed as mentioned above - look for “pure javascript”)
    Html is posted in my previous message.

  3. The form name that you’ve set and that shows in our UI
    Form name is contact.

  4. Any errors or logs from the Netlify build logs, dashboard or browser developer console
    I’m not seeing any errors currently.

  5. Description of anything you have tried that did or didn’t help or make things better/worse
    I’ve tried changing the action=“/thanks” , action=“contact#thanks” as advised in a different thread but it doesn’t seem to be the solution.

Thanks for all that!

Could you make the action a URL that is not a redirect? Something like action=/ or action=/myfile.html instead of something that is handled by a redirect? It anyway needs to start with a slash, so the second you mention is known to be nonfunctional and that is called out in the doc you linked to:

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 / […]