简体   繁体   中英

jQuery Validation Plugin stopping form submission, submit button won't work

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):

debug Boolean Default: false

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.

Removing the debug: true option will fix your problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM