<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. iOS边练边学--iOS中的(ARC下)单粒模式(GCD实现)

    一.ARC中实现单粒模式 在.m 保留一个全局的static的实例 static id _名称; 重写allocWithZone:方法,在这里创建唯一的实例 提供一个类方法让外界访问唯一的实例 实现c ...

  2. 用freemarker生产静态页面

    FreeMarker概述 * FreeMarker是一个模板引擎,一个基于模板生成文本输出的通用工具,使用纯Java编写     * Template + data model = output    ...

  3. python 类型之 set

    python的set和其他语言类似, 是一个无序不重复元素集, 基本功能包括关系测试和消除重复元素. 集合对象还支持union(联合), intersection(交), difference(差)和 ...

  4. 【poj1012】 Joseph

    http://poj.org/problem?id=1012 (题目链接) 半年前的考试题..任然清晰的记得那次差10分就AK... 题意 约瑟夫环,有前k个好人,后k个坏人,要求使得后k个坏人先死的 ...

  5. Windows Server 2008 显示桌面图标

    相信有朋友们有安装使用过windows 2008 server服务器,刚安装好的时候,桌面上只有一个回收站的图标,它没有像windows 7或windows 8一样可以直接通过右击鼠标的菜单来设置,要 ...

  6. C#获取局域网中的所有正在使用的IP地址

    方法不是很好. using System; using System.Collections.Generic; using System.Linq; using System.Text; using ...

  7. Ubuntu学习总结-03 安装软件 & 技巧

    1 UBuntu 安装 Googole Chrome 首先下载软件 wget https://dl.google.com/linux/direct/google-chrome-stable_curre ...

  8. 使用SubLineText3

    一 Sublinetext3 1. Sublime Text3是一款跨平台的编辑器, 2. 安装网址: http://www.sublimetext.com/3 二 常用使用方法 1)打开控制台: V ...

  9. TOJ3540Consumer(有依赖的背包)

    http://acm.tju.edu.cn/toj/showp3540.html3540.   Consumer Time Limit: 2.0 Seconds   Memory Limit: 655 ...

  10. 深入解析MySQL分区(Partition)功能

    自5.1开始对分区(Partition)有支持 = 水平分区(根据列属性按行分)= 举个简单例子:一个包含十年发票记录的表可以被分区为十个不同的分区,每个分区包含的是其中一年的记录. === 水平分区 ...