Last active
August 29, 2015 14:01
-
-
Save gterrill/7b51e7e437c42e930576 to your computer and use it in GitHub Desktop.
How to validate the booking form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('form[action*="/cart/add"]').submit(function(e) { | |
var btaForm = $(this).data('bta.bookingForm'); | |
if ((typeof(btaForm) != "undefined") && !btaForm.isValid()) { | |
e.stopImmediatePropagation(); // prevents BTA's default form submit handler which also checks for validity | |
return false; | |
} | |
// regular Ajax submit from here... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment