Property 'submit' of object #<HTMLFormElement> is not a function
<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:今天遇到了此错误,纠结了半天,记录一下,以警醒。
Property 'submit' of object #<HTMLFormElement> is not a function的更多相关文章
- 2.mongoDB add user in v3.0 问题的解决(Property 'addUser' of object admin is not a func)
问题:创建mongodb帐户时,出错 > db.addUser('jyu', 'aerohive') 2015-08-05T20:03:02.767+0800 E QUERY TypeE ...
- Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>' ...
- Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object’#<Object>‘的解决方法
发现问题 运行一下以前的一个Vue+webpack的 vue仿新闻网站 小项目,报错 由于自己vue学习不深入,老是这个报错,找了好久(确切的说是整整一下午^...^)才找到原因 -v- Uncau ...
- [one day one question] webpack 打包报错 Cannot assign to read only property 'exports' of object '#<Object>'
问题描述: webpack 打包报错 Cannot assign to read only property 'exports' of object '#<Object>',这怎么破? 解 ...
- Vue 使用自定义组件时报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
自己试做了一下vue的插件 参考element-ui: 写了一个组件 import message from './packages/message/index.js'; const install ...
- Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>' 点开错误的文 ...
- vue运行报错error:Cannot assign to read only property 'exports' of object '#<Object>'
用weex做项目的时候,npm start 之后一直报错error:Cannot assign to read only property 'exports' of object '#<Obje ...
- 在Vue中使用i18n 国际化遇到 Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
最近用Vue在搭建前端框架,在引用i18n时,运行的时候报错:Uncaught TypeError: Cannot assign to read only property 'exports' of ...
- Cannot assign to read only property 'exports' of object '#<Object>' ,文件名大小写问题!!!
有些坑不知道怎么就掉进去,可能一辈子都爬不起来!!! 一.错误描述 昨天还好好的,今天早上来从git获取了一下别人提交的代码就出错了!而提交代码的人 运行一点错误都没有!!! cya@KQ-101 M ...
随机推荐
- Tdrag
Tdrag属于拖拽类的一款插件,基于jquery而成,兼容1.4以上版本的jquery,兼容浏览器:chrome.firfox.IE7等以上主流浏览器 插件加载 <script type=&qu ...
- python拼接字符串
python拼接字符串一般有以下几种方法: 1.直接通过(+)操作符拼接 s = 'Hello' + ' ' + 'World' + '!' print(s) 输出结果:Hello World! 使用 ...
- IETF国标查询
IETF官网 https://www.ietf.org/ rfc国标官网 https://www.ietf.org/standards/rfcs/ rfc国标查询 https://www.rfc-ed ...
- ubuntu16.04 安装指定版本Node,升级npm到指定版本
一.安装配置Node 1.下载(64位系统) wget https://nodejs.org/download/release/v10.1.0/node-v10.1.0-linux-x64.tar.g ...
- 基于struts2框架-自定义身份证号验证器
自定义拦截器的步骤: 1.定义一个验证器的类: > 自定义的验证器都需要实现 Validator接口. > 可以选择继承 ValidatorSupport 或 FieldValidato ...
- 自定义查询语句SpringData
虽然官方的API中给我们提供了很多关键字的查询,但是还是不够灵活,因为我们在项目中,会遇见奇葩的业务,我们需要用SpringData中的一个@Query注解. 使用@Query自定义查询 这种查询可以 ...
- Smarty 模板布局继承
Smarty 模板继承 在覆盖父模板的{block}块以外的地方, 子模板不能定义任何内容.任何在{block}以外的 内容都会被自动忽略. 在子模板和父模板中的{block}内容,可以通过 appe ...
- And Design:拓荒笔记——Form表单
And Design:拓荒笔记——Form表单 Form.create(options) Form.create()可以对包含Form表单的组件进行改造升级,会返回一个新的react组件. 经 For ...
- poj1177 Picture 矩形周长并
地址:http://poj.org/problem?id=1177 题目: Picture Time Limit: 2000MS Memory Limit: 10000K Total Submis ...
- 字王4K云字库入驻github
字王4K云字库入驻github 网址:https://github.com/ziwang-com/zw4kFont 2015.3.28,字王4K云字库入驻github,原本或早或晚,不过这几天在g ...