submit is not a function

一、我为什么会搜索这个问题?

     1.我用validate插件对表单进行验证时,如果加入了remote验证,就要进行两次点击才能提交,虽然通过submitHandler暂时解决了问题,但是这并没有药到病除。

     2.我用js提交表单时,竟然提示:submit() is not a function!  外星人出现了,JS竟然不认识自己的东西了!

二、我从哪搜到答案的?

     用google.com搜索到了Spiration Home里的解决方法。

三、让我们来看看作者christo是怎么说的吧:

     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.

     原来,当你的提交按钮使用了submit这样的name后,再去调submit()方法就会出现这种错误!

posted @ 2011-05-04 17:47  策马江湖  阅读(614)  评论(2编辑  收藏  举报