Fix validation messages for select2 inputs

This commit is contained in:
Marcus Moore 2024-12-11 16:26:23 -08:00
parent 8417fcb604
commit 67494c1b0b
No known key found for this signature in database

View file

@ -996,8 +996,8 @@ dir="{{ Helper::determineLanguageDirection() }}">
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);
},