Just my luck and I ran into the dreaded submit is not a function javascript error.
Here’s the scenario.
While coding javascript along, you get a form via id or name on your html page and calls the submit() function on it. You think it should just behave as expected (submits the form) instead nothing happens and in firebug, you get a submit is not a function error. You are like WTF is going on? You start to wonder if you remembered the syntax correctly so you do some research and all the pages tell you yes it’s just submit() and nothing else.
Finally you start to search on the error “submit is not a function” you get to this page and you learned:
The reason was the statement “formObj.submit();” in the javascript was colliding (resulting in ambiguity within the browser) with the form button, which was also named “submit”.
So just rename the element within the form tag that is named “submit” will fix the problem.
Here’s an example.
HTML:
<form id="search"><input name="something" /><input type="submit" name="submit" /></form>
Javascript:
function submitForm() { document.getElementById('search').submit(); }
gives “submit is not a function” error.
Change HTML to:
<form id="search"><input name="something" /><input type="submit" name="NOT_SUBMIT" /></form>
awesome solution.I had the same probem and ur answer just works
thanks
Simply awesome!!! I was stuck with this and your solution helped..Thanks a lot
Thanks a lot. I was stuck with this problem for two weeks and tour solution was perfect for it.
Thanx a lot.. U saved my life !
thks. I came across this problem when dealing with asp.net (trying to apply a template)