From 805f357c80a83e18b0a7684fe2416cf439f3d7f6 Mon Sep 17 00:00:00 2001 From: zeeshan Date: Thu, 8 Oct 2026 16:18:44 +0530 Subject: [PATCH] Team 2 (Purview Doctor Tagging) Fetch Selected Doctors --- ...173-2ef535a8-b66e-4889-b29d-db2666f4163a.blade.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/resources/views/form/rapport-team2/1790853173-2ef535a8-b66e-4889-b29d-db2666f4163a.blade.php b/resources/views/form/rapport-team2/1790853173-2ef535a8-b66e-4889-b29d-db2666f4163a.blade.php index 2972841f..c34283c5 100644 --- a/resources/views/form/rapport-team2/1790853173-2ef535a8-b66e-4889-b29d-db2666f4163a.blade.php +++ b/resources/views/form/rapport-team2/1790853173-2ef535a8-b66e-4889-b29d-db2666f4163a.blade.php @@ -335,6 +335,8 @@ $("select[id^='field-contact_id']").each(function() { var select = $(this); // Clear previous options + + var existingValue = select.val(); select.html(''); // Add a default 'Select' option select.append( @@ -347,6 +349,11 @@ var option = $("") .attr("value", itm.value) .text(itm.display); + if (existingValue && String(existingValue) === String(itm.value)) { + option.prop('selected', true); + } + + // If doctor options have extra attributes if (itm.contact && itm.contact.msl_code) { option.attr("msl_code", itm.contact.msl_code); @@ -386,6 +393,10 @@ enforceUniqueDoctorSelections(); }); + if (existingValue) { + select.trigger('change'); + } + // Ensure unique selection is enforced after initial render enforceUniqueDoctorSelections(); });