Team 2 (Purview Doctor Tagging ) Edit issue fix
Specific Folder FTP Upload / ftp-deploy (push) Successful in 42s Details

This commit is contained in:
zeeshan 2026-10-08 16:32:39 +05:30
parent 805f357c80
commit 465574c73d
1 changed files with 14 additions and 7 deletions

View File

@ -129,7 +129,7 @@
$options = collect($question->options)->sortBy('display', SORT_NATURAL | SORT_FLAG_CASE);
@endphp
<select class="form-control" {!!($isContact)?'data-toggle="select2"':'' !!} id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
<select class="form-control" {!!($isContact)?'data-toggle="select2"':'' !!} id="field-{{ $question->code }}" name="{{ $question->code }}" data-selected="{{ isset($question->value) ? $question->value : '' }}" {{ $question->required == 'yes' ? 'required' : '' }}>
<option value=""> -- Select -- </option>
{{-- $question->options ऐवजी $options वापरा --}}
@ -336,8 +336,9 @@
var select = $(this);
// Clear previous options
var existingValue = select.val();
select.html('');
var savedValue = select.attr('data-selected') || select.data('selected') || select.val() || '';
select.empty();
// Add a default 'Select' option
select.append(
$("<option></option>")
@ -361,6 +362,11 @@
if (itm.contact && itm.contact.speciality) {
option.attr("speciality", itm.contact.speciality);
}
if (savedValue && String(savedValue) === String(itm.value)) {
option.prop('selected', true);
}
select.append(option);
});
@ -393,14 +399,15 @@
enforceUniqueDoctorSelections();
});
if (existingValue) {
select.trigger('change');
if (savedValue) {
select.val(savedValue).trigger('change');
}
});
// Ensure unique selection is enforced after initial render
enforceUniqueDoctorSelections();
});
// Enable search on doctor dropdowns
applySelect2ToDoctorDropdowns();
$("#pageloader").fadeOut();