Submit is not a function

chris (2005-11-30 14:34:46)
9944 views
9 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
Digg it! Submit to Slashdot Add to Blinklist Del.icio.us Add to Newsvine Add to Technorati Add it to Google Bookmarks Add to Magnolia
reply
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