mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Fix placement of error message
This commit is contained in:
parent
34cd106357
commit
20ae9dea19
|
@ -970,7 +970,11 @@
|
|||
errorClass: 'help-block form-error',
|
||||
errorElement: 'span',
|
||||
errorPlacement: function(error, element) {
|
||||
element.parents('.required').append(error);
|
||||
$(element).hasClass('select2')
|
||||
// If the element is a select2 then place the error above the input
|
||||
? element.parents('.required').append(error)
|
||||
// Otherwise place it after
|
||||
: error.insertAfter(element);
|
||||
},
|
||||
highlight: function(inputElement) {
|
||||
$(inputElement).parent().addClass('has-error');
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
|
||||
|
||||
<div class="col-md-7{{ ((isset($field_req)) || ((isset($required) && ($required =='true')))) ? ' required' : '' }}">
|
||||
<select class="js-data-ajax" data-endpoint="models" data-placeholder="{{ trans('general.select_model') }}" name="{{ $fieldname }}" style="width: 100%" id="model_select_id" aria-label="{{ $fieldname }}"{!! (isset($field_req) ? ' required ' : '') !!}{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
|
||||
<select class="select2 js-data-ajax" data-endpoint="models" data-placeholder="{{ trans('general.select_model') }}" name="{{ $fieldname }}" style="width: 100%" id="model_select_id" aria-label="{{ $fieldname }}"{!! (isset($field_req) ? ' required ' : '') !!}{{ (isset($multiple) && ($multiple=='true')) ? " multiple='multiple'" : '' }}>
|
||||
@if ($model_id = old($fieldname, ($item->{$fieldname} ?? request($fieldname) ?? '')))
|
||||
<option value="{{ $model_id }}" selected="selected">
|
||||
{{ (\App\Models\AssetModel::find($model_id)) ? \App\Models\AssetModel::find($model_id)->name : '' }}
|
||||
|
|
Loading…
Reference in a new issue