Submit is not a function

chris (2005-11-30 14:34:46)
90450 views
74 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
Digg it! Submit to Slashdot Add to Blinklist Del.icio.us Add to Newsvine Add to Technorati Add it to Google Bookmarks
comment
mofias
2008-04-15 12:11:38

thanks

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

Thx a lot,
I'll remember not to name my button submit :(.
reply icon
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 icon
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 icon
Jorge Ortega
2008-06-27 23:44:18

oh dear

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

Thanks

Thanks for posting this; very helpful.
reply icon
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 icon
Ron
2008-07-14 14:05:56

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

thanks

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

Thanks a lot

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

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

Thanks!

You saved me from what probably would have been quite a bit of frustration. Thanks.
reply icon
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 icon
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 icon
isaac
2008-10-07 18:32:33

Thanks man!
reply icon
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 icon
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 icon
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 icon
Tom
2008-12-03 15:13:15

You are the best!!!

Grettings from Catalonia
reply icon
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 icon
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 icon
Aju
2009-03-28 09:45:45

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

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

Thanks

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

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

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

Amazing

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

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

Thank you. You saved me a LOT of time.
reply icon
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 icon
Grandfather
2009-06-25 10:18:29

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

Great thanks

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

Doh!

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

Just saved me a lot of time too, thank you.
reply icon
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 icon
artem
2009-09-14 16:33:23

:) thanks
reply icon
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 icon
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 icon
jethro
2009-11-22 03:22:10

thanks!

thankyou thankyou thankyou!
reply icon
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 icon
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 icon
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 icon
Kelly-Anne
2010-03-09 09:39:42

Great

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

BIG THANKS! I spent two hours trying to fix the same problem!!!
reply icon
Robert
2010-05-28 15:02:18

THANKS

Saved me soms time!

Thanks
reply icon
Hemant
2010-07-03 15:43:14

Thanks a bunch.

Christo,

Thanks a bunch for saving time for me.

-Hemant
reply icon
webdev
2010-07-23 02:14:58

Nice

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 icon
Santy
2010-08-19 09:50:59

Thanks a Lot

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

Thanks a Lot
reply icon
Cian Kinsella
2010-09-01 12:23:47

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


Thanks saved me time
reply icon
Thijs
2010-09-04 18:13:25

or else

Thanks, that saved me a lot of time.
And I came up with something else:
I like my submit and want to keep it. I also have a 'onsubmit' hanging on the form wich does not fire if I do it your way. So instead of changing the name 'submit' I used onchange="submit.click(). I wouldn't have thought of that if it weren't for your post
reply icon
Raviraj Deora
2010-09-23 16:11:55

Thanks a lot

Thanks a lot!!!!! saved a lot of time
reply icon
Vlad
2010-10-09 18:19:04

Genius! Thanks a lot!!
reply icon
ed
2010-10-19 19:43:12

cheers

thanks.

this was actually starting to send me mad
reply icon
Roy
2011-01-05 14:31:38

CHeers

you saved my live thank you
reply icon
Julien Matthey
2011-02-15 18:46:08

Careful to id's too

Thank you for your post here!

You should pay attention to the ID of your button too. The same error will pop if you set your button ID to 'submit'.

Took me little time to figure it out after reading your post and removing my 'name's on the buttons.
reply icon
anonymous
2011-03-07 10:53:16

Halleluya~~~

I. would. not. have. figured. this. out!!!!
thank you!!

follow me on twitter: http://twitter.com/planet_guru
[/QUOTE]
reply icon
semanth
2011-03-07 17:29:18

thank u

thanks dude.... i have been trying this since a day....
reply icon
Andy Townsend
2011-03-18 09:12:18

Thanks

Thanks very much for your post. Much appreciated.
reply icon
sumit
2011-04-25 14:25:44

Thanks very much for your post. Much appreciated.really helped me
reply icon
M
2011-05-11 12:09:20

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 icon
jannie
2011-05-30 17:15:18

Worked for me

Thanks Buddy
reply icon
tman
2011-06-06 13:28:15

thanks

Thnx man saved ma time :)
reply icon
inteblio
2011-06-07 15:06:27

Wowthanks

I registered on this site specifically to say thanks: "Thanks".
reply icon
anonymous
2011-07-27 22:51:36

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 icon
velmurugan.cse
2011-08-11 11:13:13

Very much thank u....

Hi ,

Very very thank u for your information.




By,
Velmurugan.c
reply icon
anonymous
2011-08-31 10:54:29

Hi ,

Very very thank u for your information.




By,
Velmurugan.c
reply icon
limunsito
2011-09-07 14:35:26

you saved my life! domo arigato gozaimas!
reply icon
Ketan Kulkarni
2011-09-13 13:30:13

Thank you!

Thank you for the hint! It saved us some time.

Ketan Kulkarni
reply icon
anonymous
2011-12-16 14:28:33

wow this saves my lots of time, i am in this field since last three years but i didn't know that :)
reply icon
salman
2011-09-28 14:04:28

Can't thank you enough man.
reply icon
Sujith
2011-10-13 15:59:11

Thank you very much

I don't have words to thank you for this very simple, but MOST valuable recommendation. I was working for few days to resolve this issue on one of my websites and after seeing your comment, I could only bang my head on the table.. Why I couldn't check your post earlier... I would have saved couple of days if I went through this earlier :S

Very grateful to you man.... thanks a lot.
reply icon
Saeid
2011-11-10 10:30:21

Thank you :)

Thank you so much :)
reply icon
chirag
2011-11-10 16:09:04

Thanks a lot

Thanks a lot
reply icon