Reasons Why a HTML Form Might Not Submit

September 23rd, 2010 - Posted by Steve Marks to (X)HTML / CSS, Javascript / jQuery, Web Development.

I’ve had it lots of times throughout my career; you build a form and it will not submit. I know how frustrating this can be so I’m going to outline a few reasons why this might be below:

1. Check your HTML Structure

In order for a standard HTML form to submit successfully it requires an opening and closing <form> tag and a submit button placed within these tags. Once you have confirmed this it is important to ensure that your form does not fall within or overlap another form on the page. Also, it might seem a bit obvious, but just check that your button is of type ‘submit’ or ‘image’. A standard input of type ‘button’ will not perform any actions on it’s own.

2. JavaScript Validation Errors

If you’re using JavaScript validation on the form it could be that your page is encountering script errors. Firefox’s Error Console is a great little tool for debugging these errors should this be the case. It is also important to note that if you are using JavaScript validation, be sure to add ‘return true’ if the users input passes validation.

3. Submitting the Form with JavaScript

This has caused me hours of grief this one. You’re submitting the form using the document.myform.submit() method and nothing happens right? This is more than likely due to the fact another component in your form shares the name ‘submit’. This is a reserved Javascript word so simply change the input in question to get around this.

I’m sure there a few other scenarios which might result in a form not operating as expected and I’ll add these as I think of them. Suggestions welcome via the comments below :)

This entry was posted on Thursday, September 23rd, 2010 at 7:21 pm by +Steve Marks and is filed under (X)HTML / CSS, Javascript / jQuery, Web Development. You can follow any responses to this entry through the RSS 2.0 feed.

Fear not, we won't publish this

Comments (15)
  1. I spent two hours before realising that the problem was of my own making. In my .js I had changed the button type to disabled (to prevent the user from clicking it twice while waiting for the form to process). This stopped the form from submitting.


  2. Thank you so much… You have no clue how much your “Submitting the Form with JavaScript” point helped me… Great JOB!!

  3. Roberto says:

    thanks! It helped a lot

  4. Sumit Sharma says:

    Thanks you so much, you save my day…

  5. Demar says:

    Thanks for this helpful article! I had bind JS validators which had an error..

  6. Anonymous says:

    Thanks for the info. Was close to freaking out!

  7. Anonymous says:

    tanx alot, really help me this article

  8. ManoJr says:

    thanks a lot. This post save me this morning.

  9. usman says:

    thanx alot it is really a helpful material for me

  10. san says:

    Nice Article Really It Saved My Time and Patience

  11. jeff says:

    WOW!!! I have been looking for hours to figure out why my checkbox wouldn’t submit the form using jquery. it seemed that everything was programmed correctly- then I read your post and realized that I named my checkbox ‘submit’ and THATwas the problem!! Awesome, thanks!!

  12. Anonymous says:

    Thank you so much! The issue was a div element that ended in the wrong place, so the form tag wasn’t ending properly, if at all.

  13. Hostiee says:

    Thanks, for your helpful post.

  14. Anonymous says:

    thanks it really helped

  15. Anonymous says:

    I have one more point to add to the list. Make sure your HTML follows the proper strict guidelines. I found out my form was not submitting because I had a closing div tag inside the form while the opening div tag was outside the form.