Property 'submit' of object #<HTMLFormElement> is not a function
2013-11-18 23:41
639 查看
<form action="" type="get" id="form"> <input type="button" name="submit" id="subBtn" value="submit"> </form>
点击按钮,触发表单提交:
document.getElementById("subBtn").onclick=function(){ document.getElementById("form").submit(); }
会报错(chrome下):
Uncaught TypeError: Property 'submit' of object #<HTMLFormElement> is not a function
原因是name="submit"这句,换成别的name=sb1,sb2,sb2。。。
另外,经测,将id="submit",也会这样
同理,用于reset
一句话!!:
在表单里,别用name="submit|reset" 或 id="submit|reset"
ps:今天遇到了此错误,纠结了半天,记录一下,以警醒。
相关文章推荐
- 关于 "Uncaught TypeError: Property 'submit' of object #<HTMLFormElement> is not a function" 的解决方案
- Property 'submit' of object #<HTMLFormElement> is not a function
- Property 'submit' of object #<HTMLFormElement> is not a function
- Property 'submit' of object #<HTMLFormElement> is not a function
- 错误:document.getElementById("userForm").submit();Object is not a function
- 'GetHeadPosition' : is not a member of 'CTypedPtrList<class CObject,class CLetter *>'
- 关于xml配置文件无元素提示和the root element of the document is not <xsd:schema>.错误
- Mix of blocking and non-blocking assignments to variable <en> is not a recommended coding practice.
- 关于Uncaught TypeError: type is not a function at HTMLAnchorElement.onclick (indexjsp:71)的解决
- JS异常处理:Uncaught TypeError: xxx is not a function at HTMLAnchorElement.onclick
- 异常---ment.getElementById("searchForm").submit is not a function
- html在chrome浏览器中调试报错: object is not a function问题解决
- Uncaught TypeError: download is not a function at HTMLAnchorElement.onclick (index.html:25)
- .NET错误The 'targetFramework' attribute in the <compilation> element of the Web.config file is used only to target version 4.0 and later of the .NET Framework
- The entity type <type> is not part of the model for the current context
- The entity type <type> is not part of the model for the current context
- BEA-290074 <Deployment service servlet received file download request for file "security/SerializedSystemIni.dat". The file may exist, but download of this file is not allowed.>
- Uncaught TypeError: XX is not a function at HTMLInputElement.onclick
- collection element of type 'CGColorRef _Nullable' (aka'stuct CGColor*')is not an Objective-C object
- Uncaught TypeError: Object #<HTMLDivElement> has no method 'attr'