• jquery submit()不执行


    好吧我承认我竟然犯低级错误了。。。我忏悔。。。为了提醒自己置顶一个礼拜

    <form id="form" method="post">
    <input  type="text" name="ceshi" value="测试"/><button type="button" id="submit">提交</button>
    </form>
    <script type="text/javascript">
    $(function(){
        $('#submit').click(function(){
            $('#form').submit()
        })
    })
    </script>

    上述代码看上去貌似没什么问题,但是点击查询按钮的时候死活不提交表单,按钮type改为submit表单提交正常。


    Additional Notes: 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.

    其他注意事项: 表单和其子元素不宜用一个表单的属性的属性作为nameid的名称,如submit, length, or method,是、会产生冲突。名称冲突可能会导致混乱的失败。对于一个完整的规则列表,并检查这些问题标记,看DOMLint。

    然后我把id名字改了就执行了

  • 相关阅读:
    项目8AspNetMvc_linq技术
    uniapp vue TV端,如何接收遥控器输入
    lisp单个文件的编译
    Oracle创建定时任务
    vue2安装less
    os.path.dirname用法
    shell学习(正则表达式)
    关于测试
    QTP学习笔记
    算法题:从有序数组中查找指定值
  • 原文地址:https://www.cnblogs.com/LoveOrHate/p/4529866.html
Copyright © 2020-2023  润新知