jQuery Mobile 百分网手机站

jquery submit()不能提交表单的的原因

时间:2018-04-22 12:50:16 jQuery Mobile 我要投稿

jquery submit()不能提交表单的的原因

  复制代码 代码如下:

  用户名:

  密码:

  邮箱:

  改为

  $("#submit").click(function() {

  $("form").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.

  其他注意事项:

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

  所以将注册按钮的id改为“register”就OK了

【jquery submit()不能提交表单的的原因】相关文章:

1.jquery提交按钮的代码

2.jQuery表单步骤流程

3.jQuery简单的表单应用

4.asp教程中get post提交表单区别

5.php避免form表单重复提交

6.浅谈Ajax提交与传统表单提交的区别说明

7.讲解如何让php提交form表单

8.内存不能为written原因