Team4 - Montair LC Kid Non Rxber Survey
Specific Folder FTP Upload / ftp-deploy (push) Successful in 38s Details

allowed multiple selection in dropdown field
This commit is contained in:
Farhan Pathan 2026-06-12 15:25:56 +05:30
parent b2c364ecc7
commit a867271c88
1 changed files with 56 additions and 10 deletions

View File

@ -8,6 +8,43 @@
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<style>
/* =========================
Below CSS is for the multiple option that are selecting in field-current_prescribing_molecule_combination
========================= */
/* Selected tags in multiple select */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
background-color: #6658dd !important;
border: 1px solid #6658dd !important;
color: #fff !important;
font-weight: 600;
}
/* Cross icon */
.select2-container--default .select2-selection__choice__remove {
color: #ffffff !important;
}
.select2-container--default .select2-selection__choice__remove:hover {
color: rgb(255, 255, 255) !important;
background-color: transparent !important;
}
/* Selected option in dropdown list */
.select2-results__option[aria-selected="true"] {
background-color: #6658dd !important;
color: #fff !important;
font-weight: 600;
}
/* =========================
SELECT2 CUSTOM HIGHLIGHT
========================= */
@ -219,9 +256,11 @@
@endforeach
</select>
@else
<select class="form-control" id="execution-{{ $question->code }}"
name="{{ $question->code }}[0]"
{{ $question->required == 'yes' ? 'required' : '' }}>
<select class="form-control"
id="execution-{{ $question->code }}"
name="{{ $question->code }}[0]{{ $question->code == 'current_prescribing_molecule_combination' ? '[]' : '' }}"
{{ $question->required == 'yes' ? 'required' : '' }}
{{ $question->code == 'current_prescribing_molecule_combination' ? 'multiple' : '' }}>
<option value=""> -- Select -- </option>
@foreach ($question->options as $option)
<option value="{{ $option->value }}"
@ -352,8 +391,9 @@
placeholder: '-- Select User / Territory --'
});
$('select[id^="execution-"]').select2({
width: '100%'
$('#execution-current_prescribing_molecule_combination').select2({
width: '100%',
closeOnSelect: false
});
}
@ -563,7 +603,11 @@
<input type="{{$question->type}}" min="0" max="9999999999" step="1" id="field-{{$question->code}}-${doctor_count}" name="{{$question->code}}[${doctor_count}]" class="form-control" {{$question->required == 'yes'?'required':'' }} value="{{isset($question->value)?$question->value:0}}">
@break
@case('dropdown')
<select class="form-control" id="field-{{$question->code}}-${doctor_count}" name="{{$question->code}}[${doctor_count}]" {{$question->required == 'yes'?'required':'' }}>
<select class="form-control"
id="field-{{$question->code}}-${doctor_count}"
name="{{$question->code}}[${doctor_count}]{{ $question->code == 'current_prescribing_molecule_combination' ? '[]' : '' }}"
{{$question->required == 'yes'?'required':'' }}
{{ $question->code == 'current_prescribing_molecule_combination' ? 'multiple' : '' }}>
@if($question->code=='contact_id')
${doctorName}
@else
@ -588,12 +632,14 @@
width: '100%',
placeholder: '-- Select Doctor --'
});
$('#field-current_prescribing_molecule_combination-'+doctor_count).select2({
width: '100%',
closeOnSelect: false,
});
preventDuplicateDoctors();
$('select[id^="execution-"]').select2({
width: '100%'
});