Feat: Enhance Organising Institute selection with Select2 in forms and edit views
This commit is contained in:
@@ -25,7 +25,12 @@
|
||||
|
||||
<div>
|
||||
<label for="organising_institute" class="block text-sm font-medium text-gray-700">Organising Institute/Company</label>
|
||||
<input type="text" name="organising_institute" id="organising_institute" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
|
||||
<select name="organising_institute" id="organising_institute" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm select2" style="width: 100%;" required>
|
||||
<option value="">Select or type...</option>
|
||||
@foreach($organisingInstitutes as $institute)
|
||||
<option value="{{ $institute }}" {{ old('organising_institute') == $institute ? 'selected' : '' }}>{{ $institute }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="address" class="block text-sm font-medium text-gray-700">Brief Address (City/State/Country)</label>
|
||||
@@ -135,4 +140,17 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
@parent
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#organising_institute').select2({
|
||||
tags: true,
|
||||
placeholder: "Select or type...",
|
||||
allowClear: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user