Netlify Forms: Page Not Found 404 on Submit

I am having an issue with Netlify forms. I have successfully installed a form on a separate website of mine that is hosted on Netlify, but can’t seem to get this one to work below.

When I hit submit, I get a PAGE NOT FOUND, 404 error.

Site name: projectpassive.netlify.app

    <form name="Contact" method="POST" netlify data-netlify="true" data-netlify-honeypot="bot-field">
  <input type="hidden" name="form-name" value="contact" />
    <input type="text" name="name" placeholder="Name"/>   
    <input type="email" name="email" placeholder="Email"/>
    <textarea name="message" placeholder="Message"></textarea>
    <div class="form-btn"><button type="submit">SUBMIT</button></div>
</form>

The site is built on Vue - I have added the form code to the public index as well as in the Vue component. I have all of the proper fields in there.

Please let me know if you need more information to dissect this issue.

Thanks!

Hiya, sorry you are having trouble getting your forms to work.

This Support Guide is the first port of call to debug any forms issues. There are also many other Support Guides for forms - you can find them here: #Netlify-support:support-guides

We also recommend trying to search the forums or look at topics tagged Netlify forms if you haven’t already - it’s likely your question was already asked by someone else!

If you are still having problems, please provide more information such as what you have already tried, and a link to your live form. :slight_smile:

Hi perry,

I have gone through the support guides and read through the forums - nothing has worked.

Both links below were built by me. I got the form working on trevorcapozza.com but when I copy/pasted the code into projectpassive.io, it does not work. Everything else is the same.

projectpassive.io
trevorcapozza.com

Hi perry,

Any idea why two websites with identical code regarding the form produces two different results? I am stumped on this one.

Thanks

hey there, sorry to be so slow to reply! can you show the code to us?

also, question: do both forms have separate names? they can’t be identical.

Hi Perry,

My code is in the original question. I have also attached both websites.

projectpassive.io
trevorcapozza.com

Each website is hosted on a different Netlify account so identical form names wouldn’t matter in this instance if I understand correctly.

hi there @tcapozza - any news on this? Are you still experiencing the problem?

Hi Perry,

Yes - this problem still exists. I haven’t received any suggestions on how I might be able to resolve this.

Thanks

Hi there, @tcapozza

I appreciate your patience here and recognize we haven’t been able to work through this with you yet. We have been a bit underwater recently with a high volume of inquiries.

@jonsully, do you have any thoughts on this currently? Please let us know :slight_smile:

Are you sure the code is correct? When hitting the submit button I’m redirected away from Vue and into Netlify’s own 404 page. This probably isn’t right, are you missing a native.prevent ?

With Vue, logically, even if it doesn’t work, it shouldn’t actually change the page.

Hi Freddy,

Please read the thread. It is the same code as on trevorcapozza.com

When you click submit, it does in fact change the page (the url does not change in either instance).

Hi Trevor :wave:t2:

Welcome to The Forums :netliheart: and apologies for the long support delay.

Your page, https://projectpassive.netlify.app — does it also have a custom domain name assigned to it?


Jon

It’s not actually a Vue form in this case. Vue does indeed render the form, but it’s not hooking into the submit event or anything. Just rendering the plain HTML and letting the browser natively handle the form submission event :+1:t2:

He has posted the custom domain a whopping 3 times :confused: :stuck_out_tongue:

D’oh! You’re so right! Thanks!

Hi, @tcapozza. When Netlify’s form parser analyses a page with a <form> tag on it, our service will add a hidden <input> to the form so that when it is submitted, it includes a “form-name” field which matches the form.

On the site where this is working, you have two forms defined, “Contact” and “contact”. The “form-name” <input> is “contact” so the lower case form is the one receiving the submissions. You can see this at “Site Name” > Forms in on web UI.

For the non-working site, there is only a single form named “Contact”. Because the POST is sending “contact” it doesn’t match any forms for that site and returns a 404.

I believe if you change this line:

<input type="hidden" name="form-name" value="contact" />

to this:

<input type="hidden" name="form-name" value="Contact" />

that will resolve the issue.

Also, if you just completely delete that line, Netlify will automatically insert the correct <input> (provided the form is correctly parsed). In other words, it is normally not required (nor recommended) to manually create that <input>.

If there are other questions about this, please let us know.

Thanks Luke!

That seemed to have fixed it, I really appreciate the help.