Forms 405 error on submit

I’m getting a 405 error when I click form submission on my website. The form shows up in my forms UI. I have read every trouble shooting post I can find and I even tried testing the sample form from netlify’s forms setup page and received the same error.

Your Name:

Your Email:

Comments:

Submit

Hi @Jimbomoso! Welcome to netlify community.

Sorry to hear you’re having trouble with your form! For us to give the best advice, please provide the following:

  • The URL to your netlify site
  • The HTML/JS code of your form, Example: <form>....</form>
  • The form name
  • Any errors or logs from the Netlify build logs, dashboard or browser developer console
  • Anything you have tried that did or didn’t help or make things better/worse

Then we’ll be able to help! Thank you!

Hi Laura,

URL: Jamescmorrison.com

Form name is “contact”.

Only error is in the console: Failed to load resource: the server responded with a status of 405 ()

I’ve tried everything on Netlify’s site. The core instructions in the docs. Users solutions in the forums which were basically mostly not following the docs or a typo. I tried literally pasting netfliy’s sample form code in place of mine.

Only using HTML. HTML: I pasted this before but it looks like it didn’t take:

Your Name:

Your Email:

Comments:

Submit

<form name="contact" method="POST" data-netlify="true">
            <p>
                <label>Your Name:
                    <input type="text" name="name" required />
                </label>
            </p>
            <p>
                <label>Your Email:
                    <input type="email" name="email" required />
                </label>
            </p>
            <p>
                <label>Comments:
                    <input type="text" name="comments" required />
                </label>
            </p>
            <p>
                <button name="submit" type="submit" value="Submit">Submit</button>
            </p>
        </form>

Hi @Jimbomoso, could you remove the value="Submit" prop in your submit button? Let me know if you still have issues after doing that.

Hi Dennis, thanks for the suggestion! I just removed the value=“Submit” and the problem persists. Please let me know if you have any other ideas.

Seems like having a name attribute on your submit button is causing the form to include a subdmit field:

image

Can you remove the that too and see if the helps?

Hi Dennis,

I had so much hope this time! I removed the button name attribute and tested again, but still getting the same error.

Thanks,

James

Aha. That comes from fastly. You’d need to talk to their tech support about it. This is not a configuration that we recommend or provide tech support on (to use another CDN in front of Netlify).

This article has more details (using cloudflare as an example) about why: [Support Guide] What problems could occur when using Cloudflare in front of Netlify?

What comes from fastly and what configuration are you referring to? I went by Netlifys docs.

Your site is served by fastly. You need to repair that if you want our help and if you don’t want to repair that, you’ll have to talk to their tech support team.

You have put their CDN in front of our CDN. This is their service that you have configured DNS to point to, not ours:

$ host Jamescmorrison.com
Jamescmorrison.com has address 185.199.111.153
Jamescmorrison.com has address 185.199.108.153
Jamescmorrison.com has address 185.199.109.153
Jamescmorrison.com has address 185.199.110.153

Hi Chris,

I guess I’m in a little over my head so far, but regardless, I appreciate your help. I don’t know anything about fastly, but I recommend those addresses from setting up my URL with my site that is on github so I’m guessing fastly must be what github uses for hosting?! My ultimate goal is to have my portfolio at my URL with the ability to contact me as simply and cheaply as possible. My preference would be to do it without something like WordPress. Do you happen to have any advice/recommendations for accomplishing this?

Thanks,

James

Yup! Fixing your DNS to point to us, rather than to them. I’m not a fastly user so I can’t give additional advice, except to point out that you have not followed our DNS setup instructions here:

…which you’d need to do if:

  1. you want forms posts to reach us
  2. you want our help with tech support in case they don’t work :slight_smile: