Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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>
like image 292
user1554264 Avatar asked Jul 27 '12 11:07

user1554264


1 Answers

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.

like image 59
Frédéric Hamidi Avatar answered Sep 20 '22 15:09

Frédéric Hamidi