Home
Support Forums

"Page not found" when press submit button on a <form>

Hi, I deployed my app and get the “Page not found” error when I submit the contact form.
It’s the basic basic form for the example:

<form name="contact" method="POST" data-netlify="true">
        <p>
          <label>Name <input type="text" name="form-name"/></label>
        </p>
        <p>
          <label>Email <input type="email" name="form-email"/></label>
        </p>
        <p>
          <button type="submit">Send</button>
        </p>
      </form>

My site is: https://portfolio-edu.netlify.app/
And obviously, no mail has been sent.

I’ve been searching and testing but no solution.

thanks!

hi there @Eduars ,

Two things i am noticing.

a.) the HTML that is deployed is a little tiny bit different from what you wrote above:

<form name="contact" method="POST" data-netlify="true" action="/">

i think that in this case, the request for / as in, the root, may not be routed correctly because you have a single page application.

try the solution suggested here and see if that helps: (or, remove the action attribute, or try both)

b.) you are missing a value attribute from your name and email input fields. I don’t believe we can properly handle form submissions without, which is probably contributing to why you aren’t seeing form submissions.

go ahead and make the changes suggested, and let us know if this does/doesn’t work.

also, can you please give your post a more appropriate title so it can help others who are facing the same problem? the current title isn’t as helpful as it could be. thanks.

Hi @perry ,
I will try all of these, and sorry for the tittle, I forgot to change it.

Thanks and I will tell if this works.