/facepalmer - Form Won't Submit With jQuery/JS

This is more a word of warning post than anything else. Somehow through all my time in web development I had never encountered this issue. I simply had a form that upon confirming some information was accurate would submit the form with jQuery, very simple:

So, I was very befuddled when the form would never actually submit. I'll save the examples of things I tried over the couple hours I wasted on this, but what it boiled down to is I had a submit button on the page, and the name of the button was "submit". As it turns out, this is not a good idea. A submit button with the name or id of "submit" will override javascripts submit() function for the form.

As it turns out, all fields for a form are stored by both ID and NAME in the document.forms[0] object as properties. Consequently so is the submit() function. So name your form "submit" or give it an ID of "submit" and $('#yourform').submit() will now actually be a hook to $('#submit') or $('#yourform input[name="submit"]'). Woops!

So simple lesson, don't be a dummy like me, avoid naming submit fields "submit".