Team 2 (Lung Care Programme) Edit Mode
Specific Folder FTP Upload / ftp-deploy (push) Successful in 57s Details

This commit is contained in:
zeeshan 2026-11-17 13:40:09 +05:30
parent 6d96473c92
commit 63ee64e513
1 changed files with 19 additions and 1 deletions

View File

@ -223,6 +223,7 @@
<input class="form-check-input" type="checkbox"
id="field-{{$question->code}}-{{$option->value}}"
name="{{$question->code}}[0]" value="{{$option->value}}"
data-preselected="{{ isset($question->value) ? $question->value : '' }}"
{{isset($question->value) && $question->value != '' && in_array($option->value, $question->value) ? 'checked':''}}>
<label class="form-check-label"
for="field-{{$question->code}}-{{$option->value}}">{{$option->display}}</label>
@ -544,6 +545,9 @@
});
const $doctorSelect = $('#field-contact_id');
const preselectedDoctorId = String($doctorSelect.attr('data-preselected') || '');
$doctorSelect.empty().append($('<option></option>').val('').text('-- Select Doctor --'));
allDoctors.forEach(function (doctor) {
@ -556,7 +560,21 @@
$doctorSelect.append($option);
});
$doctorSelect.val('').trigger('change.select2');
/* $doctorSelect.val('').trigger('change.select2'); */
if (preselectedDoctorId) {
$doctorSelect.val(preselectedDoctorId);
if ($doctorSelect.val() === null) {
console.error(
'Previously selected doctor not found:',
preselectedDoctorId
);
}
}
$doctorSelect.trigger('change');
preventDuplicateDoctors();
$('#adddoctor-btn').prop('disabled', false);