<form name="formname" ...>

   ....

     <input name="submit" type="submit" class="dd" value="统计" />&nbsp;&nbsp;
            <input name="button1" type="button" class="buttonBg" onclick="aaa(1)" value="按仓库统计报表" />

</form>

<script type="text/javascript">
    function aaa(value){
        //alert(value);
        if(value == 1){
            document.formname.action = '/login.htm';
            document.formname.submit();
        }
    }
</script>

TypeError: document.echartForm.submit is not a function

这里提交的时候,出现了:

TypeError: document.formname.submit is not a function

解决:

Javascript Error: submit is not a function
有时候需要用javascript提交表单,这个时候我们会用javascript:document.formname.submit();可是我在这样做的时候怎么也提交不成功,报出javascript错误Javascript Error: submit is not a function。百思不得其解,后来查阅资料才发现,在用 document.formname.submit();提交表单的时候,表单里面不能有name="submit"的元素,否则在提交的时候,该对象会和submit();方法发生混淆造成该错误!! 切记,切记!

TypeError: document.formname.submit is not a function的更多相关文章

  1. js提交表单错误:document.form.submit() is not a function

    今天在写JS时,遇上这么个错误:"document.form.submit() is not a function",经过一番搜索,最终找到了修复方法. 这个错误一般是由于表单&l ...

  2. document.getElementById("searchForm").submit is not a function

    document.getElementById("searchForm").submit is not a function在用userForm.submit() 提交表单的时候, ...

  3. 【jQuery 区别】.click()和$(document).on("click","指定的元素",function(){});的区别

    给出以下的代码展示: //绑定 下一页 的点击事件 $("a[aria-label='Next']").click(function(){ $("a[aria-label ...

  4. Uncaught TypeError: _react2.default.findDOMNode is not a function

    react 查找某节点时报错 Uncaught TypeError: _react2.default.findDOMNode is not a function 代码: import React, { ...

  5. ie8下$(document).on('mouseover mouseout','ul li',function(){})的bug

    $(document).on('mouseover mouseout','ul li',function(){ if (event.type == 'mouseover') {           c ...

  6. Error: theForm.submit is not a function !!

    theForm.submit is not a function 调试了半天,才发现范了低级错误. 页面中有一个按钮ID 是 submit 而引发的错误. 引出的问题是页面上的元素命名范围不能是 wi ...

  7. 关于submit与document.form1.submit();这2个提交的区别

    首先要知道 一个是按钮提交 一个是在js函数里写代码 document.form1.submit() 提交 区别如下: 从使的方式及效主要有二点区别吧.一.使用submit()提交时,表单中不能存在s ...

  8. TypeError:_12.store.query is not a function

    1.错误描述 TypeError:_12.store.query is not a function                              _SearchMixin.js(第62行 ...

  9. 异常---ment.getElementById("searchForm").submit is not a function

    今天在写代码的时候JS一直报上面这个错.搞了半天一直想不明白 .我看别的页面都是这样写了就是没有一点错.. 可能是写了一个晚上的代码..头有点晕..后来终于找到原因了..浪费我两个小时啊..杯具.. ...

随机推荐

  1. Cocos2d-X3.0 刨根问底(八)----- 场景(Scene)、层(Layer)相关源码分析

    本章节我们重点分析Cocos2d-x3.0与 场景.层相关的源码.这部分源码集中在 libcocos2d –> layers_scenes_transitions_nodes目录下面 我先发个截 ...

  2. BZOJ-2242 计算器 快速幂+拓展欧几里得+BSGS(数论三合一)

    污污污污 2242: [SDOI2011]计算器 Time Limit: 10 Sec Memory Limit: 512 MB Submit: 2312 Solved: 917 [Submit][S ...

  3. Bzoj1115 石子游戏Kam

    这是道权限题,差评. 题目说明引自ZYF-ZYF Description 有N堆石子,除了第一堆外,每堆石子个数都不少于前一堆的石子个数.两人轮流操作每次操作可以从一堆石子中移走任意多石子,但是要保证 ...

  4. Erlang之父的学习历史及学习建议

    当我开始学习编程的时候(1967年),我可以在 FORTRAN 和(传说中的)Algol 之间选择,不过没有任何人了解 Algol,所以我选择了 FORTRAN. 在我最早学习编程的时候,我的编程周期 ...

  5. Type-Length-Value编码

    Within data communication protocols, optional information may be encoded as a type-length-value or T ...

  6. Jfreechart 乱码

    整个图标分成三部分chart   title,chart 的plot还有chart的   legend三个部分需要对他们分别设置字体就对了. 先看解决方法( 把这几个全部设置了,都搞定了就可以了): ...

  7. Python序列的切片操作与技巧

    切片操作 对于具有序列结构的数据来说,切片操作的方法是:consequence[start_index: end_index: step]. start_index: 表示是第一个元素对象,正索引位置 ...

  8. commons-logging和Log4j 日志管理/log4j.properties配置详解

    commons-logging和Log4j 日志管理 (zz) 什么要用日志(Log)? 这个……就不必说了吧. 为什么不用System.out.println()? 功能太弱:不易于控制.如果暂时不 ...

  9. VS自带WCF测试客户端简单介绍

    在目前的二次开发项目中,一些信息是放在客户那里的,只给你一个服务地址,不知道具体有什么方法,每次想调用一个服务不知道能不能实现目前的需求,只能测试.写个测试程序真的划不来,占用时间不说,而且你忙了一上 ...

  10. 编译过程中,termcap.h 文件找不到路径 licli.a终于生成

    编译过程中,termcap.h      文件找不到路径   查看是linux  源码下找不到termcap.h文件   安装了所有关于*cap*的源码包也不起作用     今天终于解决了这个问题,搜 ...