Javascript Error: submit is not a function

I ran into an annoying namespace issue with JavaScript. When trying to submit() a form I received a “submit is not a function” error. Simply put the error occurs because your form has a element in it with the id of submit.

In my case it was my submit button.

<input type="submit" name="submit" id="submit" value="Go" />

Changing the id (and name) resolved the issue.

<input type="submit" name="go" id="go" value="Go" />

Tags: , , , , ,

One comment

  1. Man I would have probably shot myself with a 10 gauge before I figured this out!
    Nice, will keep this in mind.

Leave a comment