JQuery Validation Plugin stopping form submit, submit button will not work

The following script using the jQuery validation plugin - http://docs.jquery.com/Plugins/Validation - prevents you from submitting the form located here:

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

Please fill out the form and make sure that the verification messages disappear, then try clicking send, this does not seem to send, and I do not understand why.

When you remove this script, the contact form will work correctly and allow submission. So I think this is causing the problem. Any help or suggestions would be greatly 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> 
+6
source share
1 answer

You run the validator in debug mode. the relevant documentation says (my attention):

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 turning it on when the form is just submitted instead of validating, stopping the submission.

Removing the debug: true option fixes your problem.

+7
source

Source: https://habr.com/ru/post/921480/


All Articles