Form.submit Is Not A Function Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and form.submit is not a function jquery validate policies of this site About Us Learn more about Stack Overflow the
Uncaught Typeerror: Document.getelementbyid(...).submit Is Not A Function
company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
Document.forms Is Not A Function
Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes
Form Is Not A Function
a minute: Sign up “Submit is not a function” error in JavaScript up vote 136 down vote favorite 28 Can anyone tell me what is going wrong with this code? I tried to submit a form with JavaScript, but an error ".submit is not a function" shown. See below for more details of the code:
I also tried this: Both show me the same error :( javascript html dom submit share|improve this question edited Dec 16 '14 at 11:23 trejder 6,4901366131 asked May 7 '09 at 5:41 SkyWeng 11.7k53112146 Which browser gives you this message? Can you post the complete source? –harto May 7 '09 at 6:05 Considering that the posted code works for me in both IE7 and Chrome2, then perhaps there is something wrong in code you haven't posted? –Lasse V. Karlsen May 7 '09 at 12:21 8 Perhaps you have a field with the name or id submit and thus .submit() is shadowed by that field? –Lasse V. Karlsen May 7 '09 at 12:22 1 So did you ever solve your problem? –epascarello May 13 '09 at 11:09 add a comment| 8 Answers 8 active oldest votes up vote 381 down vote accepted submit is not a function means that you named your submitearly theform submit is not a function asp net days of the web, there are many subtle problems and inconsistencies uncaught typeerror: document.getelementbyid is not a function that create nasty JavaScript bugs. Let’s say you have a simple contact form on your website, like this: http://stackoverflow.com/questions/833032/submit-is-not-a-function-error-in-javascript All is well until we try to attach some JavaScript to this form. If we need to inject some asynchronous action before the submit fires, like an AJAX lookup or send an analytics event, the code might look something like: var form = document.querySelector("#myForm"); form.addEventListener("submit", function (evt) { myAsyncAction(function callback() { form.submit(); }); evt.preventDefault(); - TypeError: document.getElementById(…).submit is not a functionDebugging, javascriptSometimes you try to validate HTML