jQuery Validation Plugin停止表单提交,提交按钮无法正常工作 [英] jQuery Validation Plugin stopping form submission, submit button won't work

查看:97
本文介绍了jQuery Validation Plugin停止表单提交,提交按钮无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下使用jQuery验证插件的脚本- http://docs.jquery.com/Plugins/Validation -阻止发送在此处找到的表单:

The following script using jQuery validation plugin - http://docs.jquery.com/Plugins/Validation - is preventing the form from sending that is found here:

http://www.bestcastleintown.co.uk/book2.php

请填写表格,查看确认消息消失,然后尝试按发送,这似乎没有发送,我不明白为什么.

Please fill in the form and watch the validation messages disappear then try to press send, this seems not to send and I don't understand why.

删除此脚本后,联系表单将正常运行并允许发送.因此,我认为这是造成问题的原因.任何帮助或建议,将不胜感激.

When this script is removed the contact form will function correctly and allow sending. Therefore I think it is causing the problem. Any help or suggestions would be much appreciated.

<script type="text/javascript">
jQuery.validator.setDefaults({
    debug: true,
    success: "valid"
});;
</script>

  <script>
      $(document).ready(function() {
          $("#aform").validate({
              rules: {
                  postcode: {required: true,minlength: 6},
               phone: {required: true,number: true}

              }
          });
      });
  </script>

推荐答案

您正在调试模式下运行验证器. 相关文档说(强调我):

You are running the validator in debug mode. The relevant documentation says (emphasis mine):

调试布尔默认值:false

启用调试模式.如果true未提交表单,并且控制台上显示某些错误 (需要Firebug或Firebug lite).尝试在表单刚刚启用时启用 提交,而不是停止提交.

Enables debug mode. If true, the form is not submitted and certain errors are displayed on the console (requires Firebug or Firebug lite). Try to enable when a form is just submitted instead of validation stopping the submit.

删除debug: true选项将解决您的问题.

Removing the debug: true option will fix your problem.

这篇关于jQuery Validation Plugin停止表单提交,提交按钮无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆