From 68ef61802870bcec7c1c4b319ef11a5d9bd55316 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 14 Nov 2023 16:30:29 -0800 Subject: [PATCH] Run validation on blur --- resources/views/layouts/default.blade.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php index fb3c59eb4b..815cc11667 100644 --- a/resources/views/layouts/default.blade.php +++ b/resources/views/layouts/default.blade.php @@ -965,6 +965,7 @@ $('.js-copy-link').tooltip('hide').attr('data-original-title', '{{ trans('general.copied') }}').tooltip('show'); }); + // Reference: https://jqueryvalidation.org/validate/ $('#create-form').validate({ ignore: 'input[type=hidden]', errorClass: 'help-block form-error', @@ -980,6 +981,10 @@ $(inputElement).parent().addClass('has-error'); $(inputElement).closest('.help-block').remove(); }, + onfocusout: function(element) { + // console.log($(element).valid()); + return $(element).valid(); + }, });