zoukankan      html  css  js  c++  java
  • 表单提交(四)——不能提交表单


    Forms and their child elements should not use input names or ids that conflict with properties of a form, such as submit, length, or method. Name conflicts can cause confusing failures. For a complete list of rules and to check your markup for these problems, see DOMLint.——jquery API

         表单和其子元素不能用一个表单的属性作为name或id的名称,如submit, length, or method,会产生冲突。从而导致表单提交失败。Chorme中报错:Uncaught TypeError: object is not a function

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <script type="text/javascript">
            function formSubmit()
            {
    
                document.getElementById("myForm").submit();
    
    
            }
        </script>
    </head>
    
    <body>
    
    <form id="myForm" action="http://www.baidu.com" method="get" >
        姓名:<input type="text" name="name" size="20"><br />
    
        <input type="button" onclick="formSubmit()" name="submit" id="submit" value="提交">
    </form>
    </body>
    
    </html>

     用type="submit"方法不影响。

  • 相关阅读:
    Java多线程
    JVM的结构
    CURL POST 请求
    网页504超时 apache php
    Web服务器超时处理
    apache自带压力测试工具ab详解
    好用的日期组件My97DatePicker
    CI源码阅读
    apache rewrite规则详解
    安装mysqli 扩展
  • 原文地址:https://www.cnblogs.com/xjinza/p/3907273.html
Copyright © 2011-2022 走看看