From 3ecdafa6853c72a63850363d7528af9c12d344f0 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 14 Nov 2023 16:12:47 -0800 Subject: [PATCH] Add class to error placement check --- resources/views/layouts/default.blade.php | 2 +- resources/views/partials/forms/edit/model-select.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php index 7f9f10d9e0..fb3c59eb4b 100644 --- a/resources/views/layouts/default.blade.php +++ b/resources/views/layouts/default.blade.php @@ -970,7 +970,7 @@ errorClass: 'help-block form-error', errorElement: 'span', errorPlacement: function(error, element) { - $(element).hasClass('select2') + $(element).hasClass('select2') || $(element).hasClass('js-data-ajax') // If the element is a select2 then place the error above the input ? element.parents('.required').append(error) // Otherwise place it after diff --git a/resources/views/partials/forms/edit/model-select.blade.php b/resources/views/partials/forms/edit/model-select.blade.php index 55289edc80..78073c9a66 100644 --- a/resources/views/partials/forms/edit/model-select.blade.php +++ b/resources/views/partials/forms/edit/model-select.blade.php @@ -4,7 +4,7 @@ {{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
- @if ($model_id = old($fieldname, ($item->{$fieldname} ?? request($fieldname) ?? '')))