Contact Form POST Request Returning 404

Hello, I have a contact form setup on my Netlify hosted site. The form is at https://brianli.com/contact/ and it works fine. This is the code for that form.

<form name="contact" class="contact-form width-normal" method="POST" data-netlify="true">

            <!-- Text input-->
            <div class="form-group">
                <label class="col-md-4 control-label" for="Name"></label>
                <div class="col-md-4">
                    <input id="contact-form-name" name="Name" type="text" placeholder="Name" class="form-control input-md" required="" autocomplete="off">
                </div>
            </div>

            <!-- Text input-->
            <div class="form-group">
                <label class="col-md-4 control-label" for="Email"></label>
                <div class="col-md-4">
                    <input id="contact-form-email" name="Email" type="email" placeholder="Email Address" class="form-control input-md" required="" autocomplete="off">
                </div>
            </div>

            <!-- Text input-->
            <div class="form-group">
                <label class="col-md-4 control-label" for="Subject"></label>
                <div class="col-md-4">
                    <input id="contact-form-subject" name="Subject" type="text" placeholder="Subject" class="form-control input-md" required="" autocomplete="off">
               </div>
            </div>

            <!-- Textarea -->
            <div class="form-group">
                <label class="col-md-4 control-label" for=""></label>
                    <textarea class="form-control" id="contact-form-message" name="Message" placeholder="What's up?" rows="8"></textarea>
            </div>

            <!-- Button -->
            <div class="form-group">
                    <button type="submit" value="Submit" id="Form-submit">Submit</button>
            </div>

        </form>

I am now trying to make the form redirect to my own thank you page at https://brianli.com/thank-you/. I was unable to get this working and can’t figure out why. As a test, I’ve made two more contact forms to aid in the troubleshooting process.

Here is the opening form header for https://brianli.com/contact2/

form name="contact2" class="contact-form width-normal" action="/thank-you/" method="POST" data-netlify="true">

I have assigned a name to the form (contact2) and added action="/thank-you/" to redirect the page after submission. This does not work - instead it goes to my 404 page after submissions.

Next, I tried the following on https://brianli.com/contact3/.

<form name="contact3" class="contact-form width-normal" action="/thank-you/" method="POST" data-netlify="true">
                <input type="hidden" name="form-name" value="contact3" />

I read that it may be necessary to add this hidden input field. This is not working either.

At this point, it’d be great if someone could point out what I’m doing wrong. I’ve been scratching my head for 2 days now and have read every thread/post on the topic.

Thank you!

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

This Common Issue is the first port of call to debug any forms issues.

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 after working through that guide, let us know :slight_smile: