404 error when submitting form

I want to set up my form that sends all of the info from the inputs to my Netlify account. When I do this, I get the error. Page Not Found
Looks like you’ve followed a broken link or entered a URL that doesn’t exist on this site.
I followed the instructions from this page but I am still getting a 404 error:

Here is my code:

<form method="POST"  name="contactform" data-netlify="true"  data-netlify-honeypot="bot-field" enctype="application/x-www-form-urlencoded"  >
            <input type="hidden" name="form-name" value="contact" />
            <div className="field" >
                <label>First Name</label>
                <input type="text" name="firstName" id="firstName" required />
            </div>
            <div className="field">
                <label>Last Name</label>
                <input type="text" name="lastName" id="lastName"  required />
            </div>
            <div className="field">
                <label>Email Address</label>
                <input type="email" name="portfolioemail" id="email"   />
          </div>
          <div className="field">
             <label>Message</label>
            <textarea type="message" name="portfoliomessage" id="message"/>
         </div>
            <button type="submit">Send</button>
         </form>

Here is the github link:

we’d need to see the live html file on your netlify site rather than your javascript code, as that article describes. Could you please link me to the html definition live on your site? I should be able to do something like:

curl https://site.com/form | grep '<form'

and see the definition. Having it in javascript will lead to our system never finding it and returning a 404.

I am confused on what you are asking. When you are asking me for the html definition, are you referring to the main website where this contact form is deployed?

I am asking for the URL of the html file that contains the html form definition, yes. On your website, not on GitHub :slight_smile:

https://parshanapally.netlify.com/

As you can see if you try this, there is no form definition in that html:

curl https://parshanapally.netlify.com

The form must, as the article says, be defined in an html file, and I don’t see it there. You might try building locally and finding the literal string <form in any html file, since that’s what our system would need to see to enable your form.

I’m experiencing the same issue and I’m unclear what the fix is…

my site is at https://vibrant-roentgen-afb065.netlify.com/contact

the form shows up in the inspect element… do you have any recommended fixes for me here? I’m getting a Page Not Found every time i submit.

came across an older netlify blog post:

In a React app, however, just adding a netlify attribute to a JSX form won’t work [sad trombone]. Note: If you are using a static site generator like Gatsby or React-Static, it will work but requires a form-name field, so skip to the Static Site Generator section below for examples.

1 Like

Hi @roseda.lo, I think the issue is more because your site is an SPA and this post: [Common Issue] I’ve deployed my site but I still see "Page not found” should help.

hi there, did you see this guide, also linked above?

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:

this might also be helpful:

I had this problem and it turned out that my “form-name” was set incorrectly in the js