Lager-v3/resources/views/Partials/Form/Input/brand.blade.php

32 lines
1.1 KiB
PHP

<div class="mb-3 row">
<label for="building_input" class="col-2 col-form-label fw-bold">@lang('brand') : </label>
<div class="col-10">
<select name="brand_id" id="brand_input" class="form-select" required>
<option value="" @if(old('brand_id') !== null) selected @endif>@lang('please_select')</option>
@foreach($brands as $brand)
<option
value="{{$brand->id}}"
@if(old('brand_id') !== null)
@if($brand->id == old('brand_id'))
selected
@endif
@else
@if(isset($data))
@if($brand->id == $data->brand->id)
selected
@endif
@endif
@endif
>
{{$brand->name}}
</option>
@endforeach
</select>
</div>
</div>
<script>
$("#brand_input").on( "input",function() {
$("#brand_input option:contains('Vælg...')").remove();
});
</script>