Skip to content

Commit

Permalink
Fix validation messages for select2 inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusmoore committed Dec 12, 2024
1 parent 8417fcb commit 67494c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/views/layouts/default.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -996,8 +996,8 @@
errorElement: 'span',
errorPlacement: function(error, element) {
$(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)
// If the element is a select2 then append the error to the parent div
? element.parent('div').append(error)
// Otherwise place it after
: error.insertAfter(element);
},
Expand Down

0 comments on commit 67494c1

Please sign in to comment.