From: viniciusban Date: Sun, 13 Dec 2015 06:57:19 +0000 (-0200) Subject: Submit the form if validation passes. But avoid submission if there are errors. X-Git-Tag: v6.1.0~4^2^2~23^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7519%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Submit the form if validation passes. But avoid submission if there are errors. Closes #7357 - Form validation with data-abide Closes #7127 - Form + abide validation does not submit --- diff --git a/js/foundation.abide.js b/js/foundation.abide.js index 18fe2ad28..80977e172 100644 --- a/js/foundation.abide.js +++ b/js/foundation.abide.js @@ -293,9 +293,11 @@ // what are all the things that can go wrong with a form? if ($form.find('.form-error.is-visible').length || $form.find('.is-invalid-label').length) { $form.find('[data-abide-error]').css('display', 'block'); + return false; // don't submit when there are errors } else { $form.find('[data-abide-error]').css('display', 'none'); + return true; // ok to submit } }; /**