WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Form Action Always Shows 404 Template (7 posts)

  1. jtrost
    Member
    Posted 3 years ago #

    I have a form on my homepage whose action is the homepage, like this:

    <form name="myform" action="/" method="post">

    When I submit the form it shows the 404.php template. I have tried changing the form action to a page and disabling permalinks, and I always get the 404 page after submitting the form. I have also enabled debugging in wp-config.php, but it shows no errors.

    It seems like no matter what I do submitting this form always shows the 404 page. Any ideas what is wrong here?

  2. You'll need to check the instructions for your form script and make sure you've set up your thank-you page and form action correctly. It's difficult to assist further without knowing the specifics of your form script configuration.

  3. jtrost
    Member
    Posted 3 years ago #

    That's the thing. The form action is the index page. All the form does is refresh the page with some post data.

    So if I type in "mysite.com/index.php" I see my index page. However, when I have the form action as "mysite.com/index.php" it shows a 404 error.

  4. Are you using a plug-in for your form or a separate script? Which?

  5. jtrost
    Member
    Posted 3 years ago #

    No plugin. It's just straight HTML. Here it is:

    <form action="/" name="bid-form" method="post" id="bid-form">
    <h3>Bid: <input type="text" id="the-bid" name="the-bid" /> <input type="submit" value="Place Bid" /></h3>
    </form>

    [Please post code snippets between backticks or use the code button.]

  6. jtrost
    Member
    Posted 3 years ago #

    I just solved my own problem.

    Turns out the name of the input field was the same name as a custom post type. So even though I am using post data, WordPress thought I was trying to access a post, not pass user input.

  7. Awesome. Thanks for posting the fix.

Topic Closed

This topic has been closed to new replies.

About this Topic