Submit is not a function

chris (2005-11-30 14:34:46)
43552 views
45 replies
This means you have a function trying to call the form's submit() method, but you also have a button which is called submit(). This causes a conflict in javascript, because the submit method is already bound to that button.

To solve the problem, simply change the name of the button so that name="moo" (or something). Your submit() call in your javascript function/method will now work.

It took me a while of hacking javascript and html to work that one out - hopefully this post will mean it only takes you a minute..


christo

follow me on twitter: http://twitter.com/planet_guru
comment
mofias
2008-04-15 12:11:38

thanks

thankz
i saved a lot of time by you.
reply iconedit reply
Timshel
2008-05-29 10:00:20

Thx a lot,
I'll remember not to name my button submit :(.
reply iconedit reply
anonymous
2008-06-05 19:25:11

This means you have a function trying to call the form's submit() method, but you also have a button which is called submit(). This causes a conflict in javascript, because the submit method is already bound to that button.

To solve the problem, simply change the name of the button so that name="moo" (or something). Your submit() call in your javascript function/method will now work.

It took me a while of hacking javascript and html to work that one out - hopefully this post will mean it only takes you a minute..


christo
reply iconedit reply
anon
2008-06-11 05:50:08

Bang on ... the default code provided by paypal has a submit button named submit. Just rename it to submit2 if you want to keep it.
reply iconedit reply
Jorge Ortega
2008-06-27 23:44:18

oh dear

im so stupid! how easy!
reply iconedit reply
gjf
2008-07-03 22:58:48

Thanks

Thanks for posting this; very helpful.
reply iconedit reply
Skyrider
2008-07-05 16:06:58

Nice.

This information sir, has helped me significantly. "theButtonFormerlyKnownAsSubmit" now no longer inspires me to destroy property. Hah, wasted about 4 hours on this before I finally googled it. :(
reply iconedit reply
Ron
2008-07-14 14:05:56

Thanks a lot !
reply iconedit reply
franckyboy
2008-07-17 17:40:27

thanks

Thanks a LOT!
reply iconedit reply
Joe Mak
2008-07-30 10:49:42

Thanks a lot

You save me a lot of time. Thanks!
reply iconedit reply
anonymous
2008-08-01 07:59:57

wow, thanks!! :)
reply iconedit reply
Pistos
2008-08-01 17:19:34

Thanks!

You saved me from what probably would have been quite a bit of frustration. Thanks.
reply iconedit reply
Kari J
2008-08-05 12:17:35

Saved a lot of time...


It took me a while of hacking javascript and html to work that one out - hopefully this post will mean it only takes you a minute..


It sure started to annoy me... Tnx!
reply iconedit reply
Sid
2008-09-30 10:39:09

Thanks

Ya buddy its working thanks for the help...
This means you have a function trying to call the form's submit() method, but you also have a button which is called submit(). This causes a conflict in javascript, because the submit method is already bound to that button.

To solve the problem, simply change the name of the button so that name="moo" (or something). Your submit() call in your javascript function/method will now work.

It took me a while of hacking javascript and html to work that one out - hopefully this post will mean it only takes you a minute..


christo
reply iconedit reply
isaac
2008-10-07 18:32:33

Thanks man!
reply iconedit reply
Jithu
2008-10-17 06:54:07

Thanks a lot buddy

You saved lots of time for me.
reply icon
Sarah
2008-10-22 01:10:35

Good God

I love you.
reply iconedit reply
PHP Developer
2008-10-28 13:49:42

Thanks so much

Thanks a lot for putting the time to write this note. It saved me a lot of time as I have tried so many things to figure it out and I wasn't sure what was wrong. Thanks again boss.
reply iconedit reply
irinutza
2008-11-11 14:00:47

thannkkks

thanks a lot fot posting this.
i think i would be spending some l-o-o-ng hours otherwise.
you saved my day :)
reply iconedit reply
Tom
2008-12-03 15:13:15

You are the best!!!

Grettings from Catalonia
reply iconedit reply
yogesh
2008-12-22 12:57:56

thanks

This means you have a function trying to call the form's submit() method, but you also have a button which is called submit(). This causes a conflict in javascript, because the submit method is already bound to that button.

To solve the problem, simply change the name of the button so that name="moo" (or something). Your submit() call in your javascript function/method will now work.

It took me a while of hacking javascript and html to work that one out - hopefully this post will mean it only takes you a minute..


christo

thanks for the solution .... Nice and very valuable hack...
reply iconedit reply
Mike
2009-02-04 10:01:37

Thank you Christo.

How great to get some straight-forward help from someone I've never met.

If only all coding help was this clear.
reply iconedit reply
Aju
2009-03-28 09:45:45

Thanks...It really helped...
We were stuck for hours wid this issue
reply iconedit reply
Žiga
2009-03-30 10:40:50

Saved me some time THX.
reply iconedit reply
Tki2000
2009-04-17 16:29:10

Thanks

The most useful info I've found in hours...
Thanks a lot...
reply iconedit reply
sjoerd
2009-04-22 10:55:03

Thanks.
reply iconedit reply
anonymous
2009-04-23 09:32:37

You are a saint!
reply iconedit reply
Cory
2009-05-14 04:46:49

Amazing

Saved my life. Thank you!
reply iconedit reply
anonymous
2009-06-16 17:16:27

Execellent. Thanks. Save me a bunch of headache!
reply iconedit reply
Tom Skinner
2009-06-17 00:02:53

Thank you. You saved me a LOT of time.
reply iconedit reply
Min
2009-06-22 23:21:06

thanks

Thanks alot!
I spent 3 hours trying to figure out why my form is not submitting.
Your post helped. :)
reply iconedit reply
Grandfather
2009-06-25 10:18:29

You have gotten a lot of appreciations and you deserve mine too :) - Thanks man !:)
reply iconedit reply
anti81
2009-07-10 10:06:05

Great thanks

Just two words: GREAT THANKS!
reply iconedit reply
Just Some Guy
2009-07-15 21:58:38

Doh!

dude what a lifesaver. feel like a lamebrain :P
reply iconedit reply
anonymous
2009-07-19 02:11:02

Just saved me a lot of time too, thank you.
reply iconedit reply
JerryGarciuh
2009-08-30 02:04:47

Thanks!

I can't believe I never stumbled onto this problem before. Thanks your post saved me a lot of stress!
reply iconedit reply
artem
2009-09-14 16:33:23

:) thanks
reply iconedit reply
Nathan Dizzy
2009-09-22 02:15:24

LOL!

LOL Yeh I named my button submit. That's so funny. I wouldn't have figured this out unless you posted this. Thanks much pal! :)

This means you have a function trying to call the form's submit() method, but you also have a button which is called submit(). This causes a conflict in javascript, because the submit method is already bound to that button.

To solve the problem, simply change the name of the button so that name="moo" (or something). Your submit() call in your javascript function/method will now work.

It took me a while of hacking javascript and html to work that one out - hopefully this post will mean it only takes you a minute..


christo

follow me on twitter: http://twitter.com/planet_guru
reply iconedit reply
kumar
2009-10-30 16:10:50

thanks

This means you have a function trying to call the form's submit() method, but you also have a button which is called submit(). This causes a conflict in javascript, because the submit method is already bound to that button.

To solve the problem, simply change the name of the button so that name="moo" (or something). Your submit() call in your javascript function/method will now work.

It took me a while of hacking javascript and html to work that one out - hopefully this post will mean it only takes you a minute..


christo

follow me on twitter: http://twitter.com/planet_guru
reply iconedit reply
jethro
2009-11-22 03:22:10

thanks!

thankyou thankyou thankyou!
reply iconedit reply
Oneli
2009-12-21 16:46:12

Thanks

Tks so much, i have 15 minutes with the error 'submit is not a function', because i call a button in the name 'submit'

I'll never do again


This means you have a function trying to call the form's submit() method, but you also have a button which is called submit(). This causes a conflict in javascript, because the submit method is already bound to that button.

To solve the problem, simply change the name of the button so that name="moo" (or something). Your submit() call in your javascript function/method will now work.

It took me a while of hacking javascript and html to work that one out - hopefully this post will mean it only takes you a minute..


christo

follow me on twitter: http://twitter.com/planet_guru
reply iconedit reply
drc
2010-02-19 21:58:42

Perfect

If the whole of the Internet was this concise and helpful I do believe we would have achieved absolute harmony in the universe
reply iconedit reply
Richard
2010-03-04 12:48:33

Wow! you just saved my head from exploding! I really had a hard time figuring out why my form wasn't submitting!
reply iconedit reply
Kelly-Anne
2010-03-09 09:39:42

Great

Spent a whole day trying to figure this one out, great help thanks :)
reply iconedit reply
Kenan Kujovic
2010-04-21 22:34:26

BIG THANKS! I spent two hours trying to fix the same problem!!!
reply iconedit reply